/[drupal]/contributions/modules/page_title/page_title.admin.inc
ViewVC logotype

Diff of /contributions/modules/page_title/page_title.admin.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3, Thu Oct 29 18:11:19 2009 UTC revision 1.4, Sat Oct 31 14:02:28 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: page_title.admin.inc,v 1.2 2009/08/15 22:06:17 njt1982 Exp $  // $Id: page_title.admin.inc,v 1.3 2009/10/29 18:11:19 njt1982 Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 117  function page_title_admin_settings() { Line 117  function page_title_admin_settings() {
117    );    );
118    
119    // Add the token help to a collapsed fieldset at the end of the configuration page.    // Add the token help to a collapsed fieldset at the end of the configuration page.
   /*  
120    $form['token_help'] = array(    $form['token_help'] = array(
121      '#type' => 'fieldset',      '#type' => 'fieldset',
122      '#title' => t('Available Tokens List'),      '#title' => t('Available Tokens List'),
# Line 125  function page_title_admin_settings() { Line 124  function page_title_admin_settings() {
124      '#collapsed' => TRUE,      '#collapsed' => TRUE,
125    );    );
126    $form['token_help']['content'] = array(    $form['token_help']['content'] = array(
127      '#type' => 'markup',      '#markup' => theme('page_title_token_help'),
128      '#value' => theme('token_help'),    );
   );*/  
129    
130    
131    $form = system_settings_form($form);    $form = system_settings_form($form);
# Line 158  function theme_page_title_admin_settings Line 156  function theme_page_title_admin_settings
156    $output .= drupal_render_children($form);    $output .= drupal_render_children($form);
157    return $output;    return $output;
158  }  }
159    
160    
161    /**
162     * An internal theme function to render the tokens to help the user. NOTE: Why is this not a core theme function?!
163     */
164    function theme_page_title_token_help() {
165      $token_info = token_info();
166    
167      $output = '<p>'. t('Available tokens are:') .'</p>';
168      $output .= '<dl>';
169      // TODO: Sort out user:user token help... we cant do nested tokens this way. Recursive token_help theme function needed?
170      foreach(array('node', 'term', 'vocabulary', 'site', 'date') as $key) {
171        $output .= "<dt><strong>{$token_info['types'][$key]['name']}</strong> - {$token_info['types'][$key]['description']}</dt>";
172        $token_pairs = array();
173        foreach ($token_info['tokens'][$key] as $token => $info) {
174          $token_pairs[] = "<code>[{$key}:{$token}]</code> - {$info['name']}";
175        }
176        $output .= '<dd>'. theme('item_list', array('items' => $token_pairs)) .'</dd>';
177      }
178      $output .= '</dl>';
179      return $output;
180    }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.2