示例#1
0
function theme_display_message_block()
{
    global $lang_gallery_admin_menu, $CONFIG;
    $return = '';
    if ($_SERVER['message_id'] != '') {
        $return = '<a name="cpgMessageBlock"></a><div id="cpgMessage" style="border:1px solid red;width:100%;">message block (under construction):';
        $return .= cpgFetchTempMessage($_SERVER['message_id']);
        $return .= '</div>';
    }
    if (GALLERY_ADMIN_MODE) {
        cpgCleanTempMessage();
        // garbage collection: when the admin is logged in, old messages that failed to display for whatever reason are being removed to keep the temp_messages table clean
        $return .= cpg_alert_dev_version();
        // $return .= cpg_display_rss(); //add RSS feed from coppermine-gallery.net later
    } else {
        // not in admin mode
        $return = '';
    }
    return $return;
}
function theme_display_message_block()
{
    global $lang_gallery_admin_menu, $lang_common, $CONFIG, $message_id;
    $superCage = Inspekt::makeSuperCage();
    $return = '';
    $message_id = '';
    $message_icon = '';
    $message_style = '';
    if ($superCage->get->keyExists('message_id')) {
        $message_id = $superCage->get->getEscaped('message_id');
    }
    if ($superCage->get->keyExists('message_icon')) {
        $message_icon = $superCage->get->getAlpha('message_icon');
    }
    if ($message_icon == 'error') {
        $message_style = 'cpg_message_error';
    } elseif ($message_icon == 'warning') {
        $message_style = 'cpg_message_warning';
    } elseif ($message_icon == 'validation') {
        $message_style = 'cpg_message_validation';
    } elseif ($message_icon == 'success') {
        $message_style = 'cpg_message_success';
    } else {
        $message_style = 'cpg_message_info';
    }
    if ($message_id != '') {
        $tempMessage = cpgFetchTempMessage($message_id);
        if ($tempMessage != '') {
            $return .= '<a name="cpgMessageBlock"></a>';
            $return .= <<<EOT
            <div id="cpgMessage" class="cpg_user_message {$message_style}">
              {$tempMessage}
            </div>
EOT;
        }
    }
    if (GALLERY_ADMIN_MODE) {
        $return .= cpg_alert_dev_version();
        // $return .= cpg_display_rss(); //add RSS feed from coppermine-gallery.net later
    } else {
        // not in admin mode
        //$return = '';
    }
    return $return;
}
示例#3
0
文件: theme.php 项目: alencarmo/OCF
function theme_admin_mode_menu()
{
    global $cat;
    global $lang_gallery_admin_menu, $lang_user_admin_menu;
    global $template_gallery_admin_menu, $template_user_admin_menu;
    global $CONFIG;
    $cat_l = isset($cat) ? "?cat={$cat}" : '';
    static $admin_menu = '';
    // Populate the admin menu only if empty to avoid template errors
    if ($admin_menu == '') {
        if (GALLERY_ADMIN_MODE) {
            if ($CONFIG['log_ecards'] == 0) {
                template_extract_block($template_gallery_admin_menu, 'log_ecards');
            }
            if (cpg_get_pending_approvals() == 0) {
                template_extract_block($template_gallery_admin_menu, 'admin_approval');
            }
            // do the docs exist on the webserver?
            if (file_exists('docs/index.htm') == true) {
                $documentation_href = 'docs/index.htm';
            } else {
                $documentation_href = 'http://coppermine-gallery.net/demo/cpg14x/docs/index.htm';
            }
            $param = array('{CATL}' => $cat_l, '{UPL_APP_TITLE}' => $lang_gallery_admin_menu['upl_app_title'], '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'], '{ADMIN_TITLE}' => $lang_gallery_admin_menu['admin_title'], '{ADMIN_LNK}' => $lang_gallery_admin_menu['admin_lnk'], '{ALBUMS_TITLE}' => $lang_gallery_admin_menu['albums_title'], '{ALBUMS_LNK}' => $lang_gallery_admin_menu['albums_lnk'], '{CATEGORIES_TITLE}' => $lang_gallery_admin_menu['categories_title'], '{CATEGORIES_LNK}' => $lang_gallery_admin_menu['categories_lnk'], '{USERS_TITLE}' => $lang_gallery_admin_menu['users_title'], '{USERS_LNK}' => $lang_gallery_admin_menu['users_lnk'], '{GROUPS_TITLE}' => $lang_gallery_admin_menu['groups_title'], '{GROUPS_LNK}' => $lang_gallery_admin_menu['groups_lnk'], '{COMMENTS_TITLE}' => $lang_gallery_admin_menu['comments_title'], '{COMMENTS_LNK}' => $lang_gallery_admin_menu['comments_lnk'], '{SEARCHNEW_TITLE}' => $lang_gallery_admin_menu['searchnew_title'], '{SEARCHNEW_LNK}' => $lang_gallery_admin_menu['searchnew_lnk'], '{MY_PROF_TITLE}' => $lang_user_admin_menu['my_prof_title'], '{MY_PROF_LNK}' => $lang_user_admin_menu['my_prof_lnk'], '{UTIL_TITLE}' => $lang_gallery_admin_menu['util_title'], '{UTIL_LNK}' => $lang_gallery_admin_menu['util_lnk'], '{BAN_TITLE}' => $lang_gallery_admin_menu['ban_title'], '{BAN_LNK}' => $lang_gallery_admin_menu['ban_lnk'], '{DB_ECARD_TITLE}' => $lang_gallery_admin_menu['db_ecard_title'], '{DB_ECARD_LNK}' => $lang_gallery_admin_menu['db_ecard_lnk'], '{PICTURES_TITLE}' => $lang_gallery_admin_menu['pictures_title'], '{PICTURES_LNK}' => $lang_gallery_admin_menu['pictures_lnk'], '{DOCUMENTATION_HREF}' => $documentation_href, '{DOCUMENTATION_TITLE}' => $lang_gallery_admin_menu['documentation_title'], '{DOCUMENTATION_LNK}' => $lang_gallery_admin_menu['documentation_lnk']);
            $html = template_eval($template_gallery_admin_menu, $param);
            $html .= cpg_alert_dev_version();
        } elseif (USER_ADMIN_MODE) {
            $param = array('{ALBMGR_TITLE}' => $lang_user_admin_menu['albmgr_title'], '{ALBMGR_LNK}' => $lang_user_admin_menu['albmgr_lnk'], '{MODIFYALB_TITLE}' => $lang_user_admin_menu['modifyalb_title'], '{MODIFYALB_LNK}' => $lang_user_admin_menu['modifyalb_lnk'], '{MY_PROF_TITLE}' => $lang_user_admin_menu['my_prof_title'], '{MY_PROF_LNK}' => $lang_user_admin_menu['my_prof_lnk'], '{PICTURES_TITLE}' => $lang_gallery_admin_menu['pictures_title'], '{PICTURES_LNK}' => $lang_gallery_admin_menu['pictures_lnk']);
            $html = template_eval($template_user_admin_menu, $param);
        } else {
            $html = '';
        }
        $admin_menu = $html;
    }
    return $admin_menu;
}
示例#4
0
    function theme_display_message_block()
    {
        global $lang_gallery_admin_menu, $lang_info, $CONFIG, $message_id;
        $superCage = Inspekt::makeSuperCage();
        $return = '';
        if ($superCage->get->keyExists('message_id')) {
            $message_id = $superCage->get->getEscaped('message_id');
        }
        if ($message_id != '') {
            $tempMessage = cpgFetchTempMessage($message_id);
            if ($tempMessage != '') {
                $return .= '<a name="cpgMessageBlock"></a>';
                ob_start();
                starttable(-1, $lang_info);
                $return .= ob_get_contents();
                ob_end_clean();
                $return .= <<<EOT
            <tr>
              <td class="tableb" align="center">
                <div id="cpgMessage" class="cpg_user_message">
                  {$tempMessage}
                </div>
              </td>
            </tr>
EOT;
                ob_start();
                endtable();
                $return .= ob_get_contents();
                ob_end_clean();
            }
        }
        if (GALLERY_ADMIN_MODE) {
            cpgCleanTempMessage();
            // garbage collection: when the admin is logged in, old messages that failed to display for whatever reason are being removed to keep the temp_messages table clean
            $return .= cpg_alert_dev_version();
            // $return .= cpg_display_rss(); //add RSS feed from coppermine-gallery.net later
        } else {
            // not in admin mode
            //$return = '';
        }
        return $return;
    }