Commit 405fe682 authored by JohnAlbin's avatar JohnAlbin
Browse files

Added comments and changed "templates" to "patterns" in help.

parent 1f41c7f8
......@@ -8,7 +8,7 @@ Current Maintainers: Nicholas Thompson and John Wilkins
DESCRIPTION:
This module gives you control over the page title. It gives you the chance
to provide templates for how the title should be structured, and on node
to provide patterns for how the title should be structured, and on node
pages, gives you the chance to specify the page title rather than defaulting
to the node title.
......@@ -16,7 +16,8 @@ DESCRIPTION:
PERMISSIONS:
This module defines the "set page title" permission. This permission
determines whether a user will see the "Page title" field on node edit forms.
determines whether a user will be able to edit the "Page title" field on node
edit forms (if visible.)
********************************************************************
INSTALLATION:
......
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function page_title_install() {
switch ($GLOBALS['db_type']) {
case 'mysqli':
......
......@@ -6,16 +6,16 @@
* Enhanced control over the page title (in the head tag).
*
* This module gives you control over the page title. It gives you the chance
* to provide templates for how the title should be structured, and on node
* to provide patterns for how the title should be structured, and on node
* pages, gives you the chance to specify the page title rather than defaulting
* to the node title.
*/
/**
* Implementation of hook_help().
*/
function page_title_help($section) {
switch ($section) {
case 'admin/modules#description':
$output = t('Enhanced control over the page title (in the &lt;head&gt; tag).');
break;
case 'admin/help#page_title':
$output = t('<p>Adds an extra form element to node creation forms that allows you to specify the page title.</p>
<p>Allows for better global configuration of the page title.</p>');
......@@ -25,7 +25,7 @@ function page_title_help($section) {
<ol><li><em>page title</em> | <em>site name</em></li>
<li><em>site name</em> | <em>site slogan</em></li></ol>
<p>#1 is the common case where the visitor is viewing a specific page whereas #2 is used at least for the default front page (<em>node</em>).</p>
<p>The page_title.module lets you change these defaults in two ways. First, you can adjust the templates below using the placeholders given. This will change the way the default page titles are created. Second, on every node creation form, you can have the option of specifying a title that is different than the title of the node. If a value is provided, this will be used to generate the <code>!page_title</code> placeholder. If left blank, <code>!page_title</code> will be the node's title, as is now the case.</p>");
<p>The page_title.module lets you change these defaults in two ways. First, you can adjust the patterns below using the placeholders given. This will change the way the default page titles are created. Second, on every node creation form, you can have the option of specifying a title that is different than the title of the node. If a value is provided, this will be used to generate the <code>!page_title</code> placeholder. If left blank, <code>!page_title</code> will be the node's title, as is now the case.</p>");
break;
}
return $output;
......@@ -59,7 +59,7 @@ function page_title_menu($may_cache) {
function page_title_admin_settings() {
$form['page_title'] = array(
'#type' => 'fieldset',
'#title' => t('Page title templates'),
'#title' => t('Page title patterns'),
);
$form['page_title']['page_title_individual'] = array(
'#type' => 'textfield',
......@@ -78,6 +78,9 @@ function page_title_admin_settings() {
return system_settings_form($form);
}
/**
* Implementation of hook_form_alter().
*/
function page_title_form_alter($form_id, &$form) {
if ($form['#id'] == 'node-form' && user_access('set page title')) {
$form['page_title'] = array(
......@@ -91,6 +94,9 @@ function page_title_form_alter($form_id, &$form) {
}
}
/**
* Implementation of hook_nodeapi().
*/
function page_title_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
switch ($op) {
case 'update':
......@@ -119,9 +125,13 @@ function page_title_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
}
}
/**
* Set the page title of the current page, for display on the page and in the title bar.
* Sets or retrieves the page title of the current page.
*
* @param $title
* string The page title to set.
* @return
* string The current page's title.
*/
function page_title_set_title($title = NULL) {
static $stored_title;
......@@ -135,10 +145,12 @@ function page_title_set_title($title = NULL) {
// Public API (every module's gotta have one =)
/**
* Gets the page title for a node id
* Gets the page title for a node id.
*
* @param the node's id
* @return the node's page title.
* @param $nid
* int The node's id.
* @return
* string The node's page title.
*/
function page_title_node_get_title($nid) {
$row = db_fetch_object(db_query('SELECT page_title FROM {page_title} WHERE nid = %d', $nid));
......@@ -146,8 +158,13 @@ function page_title_node_get_title($nid) {
}
/**
* Does the logic to see what title should be send to the page template. Call this function from
* the page hook of function _phptemplate_variables in template.php.
* Determines what title should be sent to the page template.
*
* Call this function from the page hook of function _phptemplate_variables in
* template.php.
*
* @return
* string The page's title.
*/
function page_title_page_get_title() {
static $title = NULL;
......
......@@ -45,7 +45,7 @@ msgid "<p>Adds an extra form element to node creation forms that allows you to s
msgstr ""
#: page_title.module:24
msgid "<p>The default page title follows one of two patterns:\n <ol><li><em>page title</em> | <em>site name</em></li>\n <li><em>site name</em> | <em>site slogan</em></li></ol>\n <p>#1 is the common case where the visitor is viewing a specific page whereas #2 is used at least for the default front page (<em>node</em>).</p>\n <p>The page_title.module lets you change these defaults in two ways. First, you can adjust the templates below using the placeholders given. This will change the way the default page titles are created. Second, on every node creation form, you can have the option of specifying a title that is different than the title of the node. If a value is provided, this will be used to generate the <code>!page_title</code> placeholder. If left blank, <code>!page_title</code> will be the node's title, as is now the case.</p>"
msgid "<p>The default page title follows one of two patterns:\n <ol><li><em>page title</em> | <em>site name</em></li>\n <li><em>site name</em> | <em>site slogan</em></li></ol>\n <p>#1 is the common case where the visitor is viewing a specific page whereas #2 is used at least for the default front page (<em>node</em>).</p>\n <p>The page_title.module lets you change these defaults in two ways. First, you can adjust the patterns below using the placeholders given. This will change the way the default page titles are created. Second, on every node creation form, you can have the option of specifying a title that is different than the title of the node. If a value is provided, this will be used to generate the <code>!page_title</code> placeholder. If left blank, <code>!page_title</code> will be the node's title, as is now the case.</p>"
msgstr ""
#: page_title.module:48;85
......@@ -53,7 +53,7 @@ msgid "Page title"
msgstr ""
#: page_title.module:62
msgid "Page title templates"
msgid "Page title patterns"
msgstr ""
#: page_title.module:66
......
......@@ -38,7 +38,7 @@ msgid "<p>Adds an extra form element to node creation forms that allows you to s
msgstr "Добавляет расширение при создании / редактирования материала в виде формы позволяющей дать странице специфичный заголовок. Позволяет улучшить глобальные настройки заголовков страниц."
#: page_title.module:24
msgid "<p>The default page title follows one of two patterns:\n <ol><li><em>page title</em> | <em>site name</em></li>\n <li><em>site name</em> | <em>site slogan</em></li></ol>\n <p>#1 is the common case where the visitor is viewing a specific page whereas #2 is used at least for the default front page (<em>node</em>).</p>\n <p>The page_title.module lets you change these defaults in two ways. First, you can adjust the templates below using the placeholders given. This will change the way the default page titles are created. Second, on every node creation form, you can have the option of specifying a title that is different than the title of the node. If a value is provided, this will be used to generate the <code>!page_title</code> placeholder. If left blank, <code>!page_title</code> will be the node's title, as is now the case.</p>"
msgid "<p>The default page title follows one of two patterns:\n <ol><li><em>page title</em> | <em>site name</em></li>\n <li><em>site name</em> | <em>site slogan</em></li></ol>\n <p>#1 is the common case where the visitor is viewing a specific page whereas #2 is used at least for the default front page (<em>node</em>).</p>\n <p>The page_title.module lets you change these defaults in two ways. First, you can adjust the patterns below using the placeholders given. This will change the way the default page titles are created. Second, on every node creation form, you can have the option of specifying a title that is different than the title of the node. If a value is provided, this will be used to generate the <code>!page_title</code> placeholder. If left blank, <code>!page_title</code> will be the node's title, as is now the case.</p>"
msgstr "<p>Заголовки страниц по умолчанию назначаются по одной из двух схем:\n <ol><li><em>Заголовок страницы</em> | <em>Название сайта</em></li>\n <li><em>Название сайта</em> | <em>Слоган сайта</em></li></ol>\n<p>#1 - общий случай, когда посетитель просматривает какие то конкретные страницы</p><p>#2 - используется по умолчанию по крайней мере на главной странице (<em>материала</em>)</p>\n<p>Модуль page_title.module позволяет менять эти значения двумя способами. Во-первых, вы можете настроить показ этих заголовков с помощью шаблонов приведенных ниже. Этот способ изменит заголовок страницы созданный по умолчанию. Во вторых, при создании материала у вас присутствует форма, где вы можете ввести название которое будет отображаться в заголовке страницы при просмотре этого материала. Если значение которое вы введете в поле редактирования шаблонов, предоставляется материалом оно может быть использовано для генерации заголовка страницы. Если левая часть шаблона пуста, в качестве заголовка страницы с материалом будет использовано значение по умолчанию.</p>"
#: page_title.module:48;85
......@@ -46,7 +46,7 @@ msgid "Page title"
msgstr "Заголовки страниц"
#: page_title.module:62
msgid "Page title templates"
msgid "Page title patterns"
msgstr "Шаблоны заголовков страниц"
#: page_title.module:66
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment