Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 16. apríl 2024

Súbor: [Platon] / Metafox / admin / inc / menu.inc.php (stiahnutie)

Revízia 1.12, Tue Jan 20 15:20:17 2015 UTC (9 years, 2 months ago) by igor


Zmeny od 1.11: +44 -1 [lines]

implement admin API for custom applications,
added cleaning cache in debug level 10,
added function array_insert into library Platon

<?php

$ezin_ADMIN_MENU = array();

/*
 * NOTE:
 *
 * Put your custom local links into the
 *
 *        menu-local.inc.php
 *
 * file with definitions like these below.
 */

$ezin_local_menu_file = dirname(__FILE__).'/menu-local.inc.php';
if (@file_exists($ezin_local_menu_file) && @is_readable($ezin_local_menu_file)) {
    include_once $ezin_local_menu_file;
}

$ezin_ADMIN_MENU[] = array(
            'action'   => 'articles',
            'caption'  => 'Articles',
            'link'     => 'articles.php',
            'inc_file' => 'articles.inc.php',
            'column'   => 'role_articles');
if (! ezin_admin_is_blog()) {
$ezin_ADMIN_MENU[] = array(
            'action'   => 'pages',
            'caption'  => 'Pages',
            'link'     => 'pages.php',
            'inc_file' => 'articles.inc.php',
            'column'   => 'role_articles');
}
$ezin_ADMIN_MENU[] = array(
            'action'   => 'boxes',
            'caption'  => 'Boxes',
            'link'     => 'boxes.php',
            'inc_file' => 'boxes.inc.php',
            'column'   => 'role_articles');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'authors',
            'caption'  => 'Authors',
            'link'     => 'authors.php',
            'inc_file' => 'authors.inc.php',
            'column'   => 'role_authors');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'sections',
            'caption'  => 'Sections',
            'link'     => 'sections.php',
            'inc_file' => 'sections.inc.php',
            'column'   => 'role_sections');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'editorials', 
            'caption'  => 'Editorials',
            'link'     => 'editorials.php',
            'inc_file' => 'editorials.inc.php',
            'column'   => 'role_editorials');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'messages',
            'caption'  => 'Messages',
            'link'     => 'messages.php',
            'inc_file' => 'messages.inc.php',
            'column'   => 'role_messages');
if (! ezin_admin_is_blog()) {
$ezin_ADMIN_MENU[] = array(
            'action'   => 'bindings',
            'caption'  => 'Bindings',
            'link'     => 'bindings.php',
            'inc_file' => 'bindings.inc.php',
            'column'   => array('role_articles', 'role_sections'));
}
$ezin_ADMIN_MENU[] = array(
            'action'   => 'polls',
            'caption'  => 'Polls',
            'link'     => 'polls.php',
            'inc_file' => 'polls.inc.php',
            'column'   => 'role_polls');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'feedbacks',
            'caption'  => 'Feedbacks',
            'link'     => 'feedbacks.php',
            'inc_file' => 'feedbacks.inc.php',
            'column'   => 'role_feedbacks');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'newsletters',
            'caption'  => 'Newsletters',
            'link'     => 'newsletters.php',
            'inc_file' => 'newsletters.inc.php',
            'column'   => 'role_newsletters');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'users',
            'caption'  => 'Users',
            'link'     => 'users.php',
            'inc_file' => 'users.inc.php',
            'column'   => 'role_users');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'roles',
            'caption'  => 'Roles',
            'link'     => 'roles.php',
            'inc_file' => 'roles.inc.php',
            'column'   => 'role_roles');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'sessions',
            'caption'  => 'Sessions',
            'link'     => 'sessions.php',
            'inc_file' => 'sessions.inc.php',
            'column'   => 'role_sessions');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'sources',
            'caption'  => 'Sources',
            'link'     => 'sources.php',
            'inc_file' => 'sources.inc.php',
            'column'   => 'role_sections');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'exports',
            'caption'  => 'Exports',
            'link'     => 'exports.php',
            'inc_file' => 'exports.inc.php',
            'column'   => 'role_config');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'config',
            'caption'  => 'Config',
            'link'     => 'config.php',
            'inc_file' => 'config.inc.php',
            'column'   => 'role_config');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'maintenance',
            'caption'  => 'Maintenance',
            'link'     => 'maintenance.php',
            'inc_file' => 'maintenance.inc.php',
            'column'   => 'role_config');
$ezin_ADMIN_MENU[] = array(
            'action'   => 'file_management',
            'caption'  => 'File mng',
            'link'     => 'file-mng.php',
            'column'   => 'role_file_management');
if (strlen($ezin_cfg['admin_auth_function']) > 0 && function_exists($ezin_cfg['admin_auth_function'])) {
    // nothing
} else {
    $ezin_ADMIN_MENU[] = array(
                'action'   => 'password',
                'caption'  => 'Password',
                'link'     => 'password.php',
                'inc_file' => 'password.inc.php');
}
$ezin_ADMIN_MENU[] = array(
        'action'   => 'help',
        'caption'  => 'Help',
        'link'     => 'help.php',
        'inc_file' => 'help.inc.php');
$ezin_ADMIN_MENU[] = array(
            'caption'  => 'Logout',
            'link'     => 'logout.php');

/*
 * Load menu for custom applications
 *
 * Admin API: ezin_admin_menu_add(action, caption, link, inc_file, column [, after_action [, visible]]);
 */
$ezin_tmp_ADMIN_MENU = array();
foreach(ezin_admin_menu_get() as $menu) {
    if (!$menu['visible']) {
        continue;
    }
    $item = array(
        'action'   => $menu['action'],
        'caption'  => $menu['caption'],
        'link'     => 'app/'.$menu['app_dir'].'/'.$menu['link'],
        'inc_file' => $menu['inc_file'],
        'column'   => $menu['column']
    );
    if (is_null($menu['after_action'])) {
        $ezin_tmp_ADMIN_MENU[] = $item;
    } else {
        $index = 0;
        if ($index == 0) foreach($ezin_ADMIN_MENU as $key => $val) {
            if ($val['action'] == $menu['after_action']) {
                $index = $key;
            }
        }
        if ($index > 0) {
            $ezin_ADMIN_MENU = Platon::array_insert($ezin_ADMIN_MENU, $index, $item);
            $index *= -1;
        }
        if ($index == 0) foreach($ezin_tmp_ADMIN_MENU as $key => $val) {
            if ($val['action'] == $menu['after_action']) {
                $index = $key;
            }
        }
        if ($index > 0) {
            $ezin_tmp_ADMIN_MENU = Platon::array_insert($ezin_tmp_ADMIN_MENU, $index, $item);
            $index *= -1;
        }
    }
}
$ezin_ADMIN_MENU = array_merge($ezin_tmp_ADMIN_MENU, $ezin_ADMIN_MENU);

?>

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok