/[drupal]/contributions/modules/ad/channel/ad_channel.module
ViewVC logotype

Diff of /contributions/modules/ad/channel/ad_channel.module

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

revision 1.1.4.4, Sun Mar 1 00:00:06 2009 UTC revision 1.1.4.5, Sun Mar 1 00:22:09 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: ad_channel.module,v 1.1.4.3 2009/02/28 05:35:13 jeremy Exp $  // $Id: ad_channel.module,v 1.1.4.4 2009/03/01 00:00:06 jeremy Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 44  function ad_channel_perm() { Line 44  function ad_channel_perm() {
44  function ad_channel_menu() {  function ad_channel_menu() {
45    $items = array();    $items = array();
46    
   //return (array('administer channels', 'configure ad premier status'));  
47    $items['admin/content/ad/channel'] = array(    $items['admin/content/ad/channel'] = array(
48      'title' => t('Channels'),      'title' => t('Channels'),
49      'page callback' => 'ad_channel_admin_overview',      'page callback' => 'ad_channel_admin_overview',
# Line 170  function ad_channel_form_alter(&$form, & Line 169  function ad_channel_form_alter(&$form, &
169   */   */
170  function ad_channel_nodeapi($node, $op, $arg = 0) {  function ad_channel_nodeapi($node, $op, $arg = 0) {
171    switch ($op) {    switch ($op) {
172        case 'view':
173          return _ad_channel_view_node($node);
174      case 'load':      case 'load':
175        return _ad_channel_load_node($node);        return _ad_channel_load_node($node);
176      case 'insert':      case 'insert':
# Line 241  function ad_channel_admin_settings() { Line 242  function ad_channel_admin_settings() {
242  }  }
243    
244  /**  /**
245     * Add channel information when viewing node.
246     */
247    function _ad_channel_view_node($node) {
248      if (isset($node->adtype) && user_access('administer channels')) {
249        if (isset($node->channel) && is_array($node->channel) && !empty($node->channel)) {
250          $channels = array();
251          foreach ($node->channel as $chid) {
252            $channel = _ad_channel_get_channels($chid);
253            $channels[] = $channel->name;
254          }
255          $node->content['channel'] = array(
256            '#value' => theme('box', t('Channels'), theme('item_list', $channels)),
257            '#weight' => 1,
258          );
259        }
260      }
261    }
262    
263    /**
264   * Load channels associated with specified node.   * Load channels associated with specified node.
265   */   */
266  function _ad_channel_load_node($node) {  function _ad_channel_load_node($node) {

Legend:
Removed from v.1.1.4.4  
changed lines
  Added in v.1.1.4.5

  ViewVC Help
Powered by ViewVC 1.1.2