Mercurial > defr > drupal > ad
diff html/ad_html.module @ 1:948362c2a207 ad
update advertisement
author | pierre |
---|---|
date | Thu, 02 Apr 2009 15:28:21 +0000 |
parents | d8a3998dac8e |
children |
line wrap: on
line diff
--- a/html/ad_html.module Fri Feb 20 14:04:09 2009 +0000 +++ b/html/ad_html.module Thu Apr 02 15:28:21 2009 +0000 @@ -1,5 +1,5 @@ <?php -// $Id: ad_html.module,v 1.1.2.5.2.8 2009/02/17 18:56:26 jeremy Exp $ +// $Id: ad_html.module,v 1.1.2.5.2.8.2.3 2009/02/28 23:35:26 jeremy Exp $ /** * @file @@ -28,7 +28,9 @@ function theme_ad_html_ad($ad) { if (isset($ad->aid)) { $output = '<div class="html-advertisement" id="ad-'. $ad->aid .'">'; - $output .= check_markup($ad->html, $ad->format, FALSE); + if (isset($ad->html) && isset($ad->format)) { + $output .= check_markup($ad->html, $ad->format, FALSE); + } $output .= '</div>'; return $output; } @@ -107,7 +109,7 @@ ); case 'permissions': if (!isset($node->adtype) || $node->adtype == 'html') { - return array('manage ad html'); + return array('manage ad html' => TRUE); } } } @@ -129,7 +131,7 @@ '#value' => ad_html_display_ad($node), ); - if (ad_adaccess($node, 'manage ad html') || arg(1) == 'add' && user_access('create advertisements')) { + if (isset($node->nid) && ad_permission($node->nid, 'manage ad html') || arg(1) == 'add' && user_access('create advertisements')) { $form['ad_html']['html'] = array( '#type' => 'textarea', '#title' => t('Ad HTML'),