/[drupal]/contributions/modules/send/includes/send.template.inc
ViewVC logotype

Diff of /contributions/modules/send/includes/send.template.inc

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

revision 1.4, Fri May 22 17:18:35 2009 UTC revision 1.5, Wed Aug 26 01:18:14 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: send.template.inc,v 1.3 2009/05/22 15:21:55 vauxia Exp $  <?php // $Id: send.template.inc,v 1.4 2009/05/22 17:18:35 vauxia Exp $
2    
3  function send_template_load($stid) {  function send_template_load($stid) {
4    $template = db_fetch_object(db_query("SELECT * FROM {send_template} WHERE stid = %d", $stid));    $template = db_fetch_object(db_query("SELECT * FROM {send_template} WHERE stid = %d", $stid));
# Line 60  function send_template_form($form_state, Line 60  function send_template_form($form_state,
60      '#title' => t('Subject is editable'),      '#title' => t('Subject is editable'),
61      '#default_value' => $template->subject_editable,      '#default_value' => $template->subject_editable,
62    );    );
63    $build_modes = send_build_modes();    $build_modes = send_template_build_modes();
64    if (module_exists('token')) {    if (module_exists('token')) {
65      $build_modes[] = t("None, I'll add the node tokens myself");      $build_modes[] = t("None, I'll add the node tokens myself");
66    }    }
# Line 157  function send_template_list($profile = N Line 157  function send_template_list($profile = N
157    
158    return $templates;    return $templates;
159  }  }
160    
161    /**
162     * A helper function returning a list of node build_modes.
163     */
164    function send_template_build_modes() {
165      static $build_modes;
166      if (!isset($build_modes)) {
167        $build_modes = array();
168    
169        // CCK is installed, use its hooks.
170        if (function_exists('content_build_modes')) {
171          foreach (content_build_modes() as $name => $info) {
172            $build_modes[$name] = $info['title'];
173          }
174        }
175    
176        // Set generic defaults.
177        else {
178          $build_modes['teaser'] = t('Teaser');
179          $build_modes['full'] = t('Full node');
180        }
181      }
182      return $build_modes;
183    }
184    

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

  ViewVC Help
Powered by ViewVC 1.1.2