Changeset 4342


Ignore:
Timestamp:
Nov 22, 2009, 6:34:35 PM (14 years ago)
Author:
LucMorizur
Message:

[Event Cats] Remove define of EC_AP_OK with a mysql query in main.inc.php

(See http://code.piwigo.org/issues/show/1249 )

Location:
extensions/event_cats
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/admin/autolog_entries.inc.php

    r4336 r4342  
    113113        case 2: // Additional Page
    114114          $url_end = ($ec_entry['forced'] == 'true') ? '' : '&ap='.$arg2;
    115           $dspl = (EC_AP_OK) ? sprintf(
     115          $dspl = (defined('ADD_PAGES_TABLE')) ? sprintf(
    116116            l10n('ec_dspl_ok_ap'),
    117117            $arg2, $ec_lists['add_pages'][$arg2_int]
     
    126126      }
    127127      else {
    128         $dspl = (EC_AP_OK) ? sprintf(
     128        $dspl = (defined('ADD_PAGES_TABLE')) ? sprintf(
    129129            l10n('ec_dspl_ok_ap'),
    130130            $arg2, $ec_lists['add_pages'][$arg2_int]
     
    220220}
    221221
    222 $template->assign('ec_ap_ok',  EC_AP_OK);
     222$template->assign('ec_ap_ok',  defined('ADD_PAGES_TABLE'));
    223223$template->assign('ec_ap_ok2', (count($ec_lists['add_pages']) > 0));
    224224$template->assign('code_list', $code_list);
  • extensions/event_cats/admin/autolog_new.inc.php

    r4336 r4342  
    103103"))) == 0));
    104104$template->assign('ec_is_creation',         $ec_is_creation);
    105 $template->assign('ec_ap_ok',               EC_AP_OK);
     105$template->assign('ec_ap_ok',               defined('ADD_PAGES_TABLE'));
    106106$template->assign('ec_lists',               $ec_lists);
    107107$template->assign('ec_default_entry',       $ec_default_entry);
  • extensions/event_cats/admin/config.inc.php

    r4336 r4342  
    6262load_language('plugin.lang', EVNTCATS_PATH);
    6363
    64 $template->assign('ec_ap_ok', EC_AP_OK);
     64$template->assign('ec_ap_ok', defined('ADD_PAGES_TABLE'));
    6565$template->assign('add_pages', $ec_lists['add_pages']);
    6666
  • extensions/event_cats/include/evntcats_main_funcs.inc.php

    r4333 r4342  
    183183function build_ec_addp() {
    184184  global $ec_lists;
    185   if (EC_AP_OK) {
     185  if (defined('ADD_PAGES_TABLE')) {
    186186    $res = pwg_query("SELECT `id`, `title` FROM `".ADD_PAGES_TABLE."`");
    187187    while ($r = mysql_fetch_assoc($res)) {
     
    289289      case 2: // Additional Page
    290290        if (
    291           EC_AP_OK and (
     291          defined('ADD_PAGES_TABLE') and (
    292292            is_in($ec_entry['action'], 'ec_ok') or
    293293            $ec_entry['action'] == 'ec_nok'
  • extensions/event_cats/main.inc.php

    r4338 r4342  
    5555  'ROOT_URL',
    5656   get_absolute_root_url()
    57 );
    58 define(
    59   'EC_AP_OK', // whether Additional Pages is installed and activated
    60    (mysql_num_rows(pwg_query("
    61      SELECT *
    62      FROM `".PLUGINS_TABLE."`
    63      WHERE `id`    = 'AdditionalPages'
    64        AND `state` = 'active';
    65    ")) != 0)
    6657);
    6758
Note: See TracChangeset for help on using the changeset viewer.