/**
 * BlankTheme plugin to display the user navigation submenu.
 *
 * Available parameters:
 *  - id           (string) ID of the wrapper div (default: 'nav_main')
 *  - current      (string) Current screen ID (.ini current value or module name) (optional)
 *  - currentclass (string) CSS class name of the current tab, list item (default: 'current')
 *  - span         (bool)   Flag to enable SPAN wrappers on the links text, useful for sliding doors (default: false)
 *
 * Example:
 *  {bt_usersublinks id='nav' current='home' currentclass='myActiveClass'}
 *
 * @author Mateo Tibaquirá
 * @since  19/06/11
 *
 * @param array             $params All parameters passed to this function from the template.
 * @param Zikula_View_Theme &$view  Reference to the View_Theme object.
 *
 * @return string User submenu output.
 */
function smarty_function_bt_usersublinks($params, Zikula_View_Theme &$view)
{
    $dom = ZLanguage::getThemeDomain('BlankTheme');

    $id = isset($params['id']) ? $params['id'] : 'nav_sub';
    if (!isset($params['current'])) {
        $current = $view->getTplVar('current') ? $view->getTplVar('current') : $view->getToplevelmodule();
    } else {
        $current = $params['current'];
    }
    $currentclass = isset($params['currentclass']) ? $params['currentclass'] : 'current';
    $span = isset($params['span']) ? (bool)$params['span'] : false;

    $currentsub = $current.'-'.$view->getTplVar('type').'-'.$view->getTplVar('func');

    /*** Build the submenu-array ***/
    $menu = array();

    // dummy example links
    $menu['home'][] = array(
                          '',                       // page id : current-type-func
                          __('Home Sublink', $dom), // translatable title
                          '',                       // translatable description
                          '#'                       // link
                      );

    $menu['home'][] = array(
                          '',
                          __('Second Sublink', $dom),
                          '',
                          '#'
                      );

    // render the submenu
    $output = '';

    if (isset($menu[$current])) {
        $output .= '<div id="'.$id.'"><ul>';
        foreach ($menu[$current] as $option) {
            $output .= bt_usersublinks_drawmenu($option, $currentsub, $currentclass, $span);
        }
        $output .= '</ul></div>';
    }

    return $output;
}
/**
 * BlankTheme plugin to display the user navigation menu.
 *
 * Available parameters:
 *  - id           (string) ID of the wrapper div (default: 'nav_main')
 *  - current      (string) Current screen ID (.ini current value or module name) (optional)
 *  - currentclass (string) CSS class name of the current tab, list item (default: 'current')
 *  - span         (bool)   Flag to enable SPAN wrappers on the links text, useful for sliding doors (default: false)
 *  - desc         (bool)   Flag to put the parent links descriptions inside SPAN.bt_desc instead the link title (default: false)
 *
 * Example:
 *  {bt_userlinks id='myId' current='home' currentclass='myActiveClass'}
 *
 * @author Mateo Tibaquirá
 * @since  08/11/07
 *
 * @param array             $params All parameters passed to this function from the template.
 * @param Zikula_View_Theme &$view  Reference to the View_Theme object.
 *
 * @return string User menu output.
 */
function smarty_function_bt_userlinks($params, Zikula_View_Theme &$view)
{
    $dom = ZLanguage::getThemeDomain('BlankTheme');

    $id = isset($params['id']) ? $params['id'] : 'nav_main';
    if (!isset($params['current'])) {
        $current = $view->getTplVar('current') ? $view->getTplVar('current') : $view->getToplevelmodule();
    } else {
        $current = $params['current'];
    }
    $currentclass = isset($params['currentclass']) ? $params['currentclass'] : 'current';
    $span = isset($params['span']) ? (bool)$params['span'] : false;
    $desc = isset($params['desc']) ? (bool)$params['desc'] : false;

    /*** Build the menu-array ***/
    $menu   = array();
    $menu[] = array(
                  'home',                      // page id / module name
                  __('Home', $dom),            // translatable title
                  __('Go to home page', $dom), // translatable description
                  System::getHomepageUrl(),    // link
                  null                         // array of sublinks (optional)
              );

    if (ModUtil::available('News')) {
        $menu[] = array(
                      'News',
                      __('News', $dom),
                      __('Articles index', $dom),
                      ModUtil::url('News', 'user', 'main')
                  );
    }

    if (ModUtil::available('Pages')) {
        $menu[] = array(
                      'Pages',
                      __('Pages', $dom),
                      __('Content section', $dom),
                      ModUtil::url('Pages', 'user', 'main')
                  );
    }

    if (ModUtil::available('Dizkus')) {
        $menu[] = array(
                      'Dizkus',
                      __('Forums', $dom),
                      __('Discuss area', $dom),
                      ModUtil::url('Dizkus', 'user', 'main')
                  );
    }

    if (ModUtil::available('FAQ')) {
        $menu[] = array(
                      'FAQ',
                      __('FAQ', $dom),
                      __('Frequent questions', $dom),
                      ModUtil::url('FAQ', 'user', 'main')
                  );
    }

    if (ModUtil::available('Wikula')) {
        $menu[] = array(
                      'Wikula',
                      __('Wiki', $dom),
                      __('Documents', $dom),
                      ModUtil::url('Wikula', 'user', 'main')
                  );
    }

    if (ModUtil::available('TimeIt')) {
        $menu[] = array(
                      'TimeIt',
                      __('Calendar', $dom),
                      __('List of events', $dom),
                      ModUtil::url('TimeIt', 'user', 'main')
                  );
    }

    if (ModUtil::available('crpCalendar')) {
        $menu[] = array(
                      'crpCalendar',
                      __('Calendar', $dom),
                      __('List of events', $dom),
                      ModUtil::url('crpCalendar', 'user', 'main')
                  );
    }

    if (ModUtil::available('Formicula')) {
        $menu[] = array(
                      'Formicula',
                      __('Contact us', $dom),
                      __('Comment or suggest', $dom),
                      ModUtil::url('Formicula', 'user', 'main')
                  );
    }

    // render the menu
    $output  = '<div id="'.$id.'"><ul>';
    foreach ($menu as $option) {
        $output .= bt_userlinks_drawmenu($option, $current, $currentclass, $span, $desc);
    }
    $output .= '</ul></div>';

    return $output;
}
Esempio n. 3
0
 /**
  * Constructor.
  *
  * @param Zikula_ServiceManager $serviceManager ServiceManager.
  * @param string                $themeName      Theme name.
  */
 public function __construct(Zikula_ServiceManager $serviceManager, $themeName)
 {
     // store our theme information
     $this->themeinfo = ThemeUtil::getInfo(ThemeUtil::getIDFromName($themeName));
     // prevents any case mismatch
     $themeName = $this->themeinfo['name'];
     foreach (array('name', 'directory', 'version', 'state', 'xhtml') as $key) {
         $this->{$key} = $this->themeinfo[$key];
     }
     parent::__construct($serviceManager);
     if ($this->themeinfo['i18n']) {
         ZLanguage::bindThemeDomain($this->name);
         // property for {gt} template plugin to detect language domain
         $this->domain = ZLanguage::getThemeDomain($this->name);
     } else {
         $this->domain = null;
     }
     EventUtil::attachCustomHandlers("themes/{$themeName}/EventHandlers");
     EventUtil::attachCustomHandlers("themes/{$themeName}/lib/{$themeName}/EventHandlers");
     $event = new \Zikula\Core\Event\GenericEvent($this);
     $this->eventManager->dispatch('theme.preinit', $event);
     // change some base settings from our parent class
     // template compilation
     $this->compile_dir = CacheUtil::getLocalDir('Theme_compiled');
     $this->compile_check = ModUtil::getVar('ZikulaThemeModule', 'compile_check');
     $this->force_compile = ModUtil::getVar('ZikulaThemeModule', 'force_compile');
     // template caching
     $this->cache_dir = CacheUtil::getLocalDir('Theme_cache');
     $this->caching = (int) ModUtil::getVar('ZikulaThemeModule', 'enablecache');
     //if ($this->caching) {
     //    $this->cache_modified_check = true;
     //}
     // if caching and is not an admin controller
     if ($this->caching && strpos($this->type, 'admin') !== 0) {
         $modulesnocache = array_filter(explode(',', ModUtil::getVar('ZikulaThemeModule', 'modulesnocache')));
         if (in_array($this->toplevelmodule, $modulesnocache)) {
             $this->caching = Zikula_View::CACHE_DISABLED;
         }
     } else {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     // halt caching for write operations to prevent strange things happening
     if (isset($_POST) && count($_POST) != 0) {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     // and also for GET operations with csrftoken/authkey
     if (isset($_GET['csrftoken']) || isset($_GET['authkey'])) {
         $this->caching = Zikula_View::CACHE_DISABLED;
     }
     $this->cache_lifetime = ModUtil::getVar('ZikulaThemeModule', 'cache_lifetime');
     if (!$this->homepage) {
         $this->cache_lifetime = ModUtil::getVar('ZikulaThemeModule', 'cache_lifetime_mods');
     }
     // assign all our base template variables
     $this->_base_vars();
     // define the plugin directories
     $this->_plugin_dirs();
     // load the theme configuration
     $this->load_config();
     // check for cached output
     // turn on caching, check for cached output and then disable caching
     // to prevent blocks from being cached
     if ($this->caching && $this->is_cached($this->themeconfig['page'], $this->cache_id)) {
         $this->display($this->themeconfig['page'], $this->cache_id);
         System::shutdown();
     }
     // register page vars output filter
     $this->load_filter('output', 'pagevars');
     // register short urls output filter
     if (System::getVar('shorturls')) {
         $this->load_filter('output', 'shorturls');
     }
     // register trim whitespace output filter if requried
     if (ModUtil::getVar('ZikulaThemeModule', 'trimwhitespace')) {
         $this->load_filter('output', 'trimwhitespace');
     }
     $this->load_filter('output', 'asseturls');
     $event = new \Zikula\Core\Event\GenericEvent($this);
     $this->eventManager->dispatch('theme.init', $event);
     $this->startOutputBuffering();
 }
/**
 * BlankTheme plugin to centralize important outputs.
 *
 * Available parameters:
 *  - section (string) Name of the output section to return.
 *  - noempty (bool)   Flag to disable the "bt-empty" CSS class for the classesinnerpage section.
 *
 * Example:
 *  {bt_htmloutput section='head'}
 *  {bt_htmloutput section='topnavlinks'}
 *
 * @author Mateo Tibaquirá
 * @since  05/07/08
 *
 * @param array             $params All parameters passed to this function from the template.
 * @param Zikula_View_Theme &$view  Reference to the View_Theme object.
 *
 * @return string Output of the requested section.
 */
function smarty_function_bt_htmloutput($params, Zikula_View_Theme &$view)
{
    $dom = ZLanguage::getThemeDomain('BlankTheme');

    // section parameter check
    if (!isset($params['section']) || empty($params['section'])) {
        return '';
    }

    // blanktheme vars
    $body      = $view->getTplVar('body');
    $layout    = $view->getTplVar('layout');
    $btconfig  = $view->getTplVar('btconfig');
    $btcssbody = $view->getTplVar('btcssbody');

    // check for the current variable
    if ($view->getTplVar('current')) {
        $current = $view->getTplVar('current');
    } else {
        $current = $view->getToplevelmodule();
        $view->assign('current', $current);
    }

    // process the respective output
    $output = '';

    switch ($params['section'])
    {
        case 'topnavlinks':
            // build the menu list
            // option: {id, translatable link text, link}
            $menu = array();
            if (UserUtil::isLoggedIn()) {
                if ($view->getTplVar('type') != 'admin' && SecurityUtil::checkPermission('::', '::', ACCESS_ADMIN)) {
                    $menu[] = array('admin', __('Admin', $dom), ModUtil::url('Admin', 'admin', 'adminpanel'));
                }
                $profileModule = System::getVar('profilemodule', '');
                if (!empty($profileModule) && ModUtil::available($profileModule)) {
                    $menu[] = array('account', __('Your account', $dom), ModUtil::url($profileModule, 'user', 'main'));
                }
                $menu[] = array('logout', __('Log out', $dom), ModUtil::url('Users', 'user', 'logout'));
            } else {
                $menu[] = array('register', __('Register', $dom), ModUtil::url('Users', 'user', 'register'));
                $menu[] = array('login', __('Login', $dom), ModUtil::url('Users', 'user', 'login'));
            }
            // render the menu
            $count   = count($menu) - 1;
            $output  = '<div id="bt_topnavlinks"><ul>';
            foreach ($menu as $k => $option) {
                $class = '';
                if (count($menu) == 1) {
                    $class = 'unique';
                } elseif ($k == 0) {
                    $class = 'first';
                } elseif ($k == $count) {
                    $class = 'last';
                }
                $output .= '<li '.($class ? ' class="bt_'.$class.'"' : '').'>';
                if (!empty($option[2])) {
                    $output .= '<a title="'. DataUtil::formatForDisplay($option[1]). '" href="'.DataUtil::formatForDisplay($option[2]).'"><span>'. DataUtil::formatForDisplay($option[1]). '</span></a>';
                } else {
                    $output .= '<span>'. DataUtil::formatForDisplay($option[1]). '</span>';
                }
                $output .= '</li>';
            }
            $output .= '</ul></div>';
            break;

        case 'fontresize':
            if ($btconfig['fontresize'] != '1') {
                break;
            }
            // font resize based in the efa script
            PageUtil::addVar('javascript', $view->getScriptpath().'/efa/efa_fontsize_packed.js');
            //PageUtil::addVar('javascript', $view->getScriptpath().'/efa/efa_fontsize.js');
            $output = '<script type="text/javascript">
                         // <![CDATA[
                         if (efa_fontSize) {
                           var efalang_zoomIn = "'.__('Increase font size', $dom).'";
                           var efalang_zoomReset = "'.__('Reset font size', $dom).'";
                           var efalang_zoomOut = "'.__('Decrease font size', $dom).'";
                           var efathemedir = "'.$view->getDirectory().'";
                           efa_fontSize.efaInit();
                           document.write(efa_fontSize.allLinks);
                         }
                         // ]]>
                       </script>
                       ';
            break;

        case 'head':
            // head stylesheets
            $output .= '<!--[if lte IE 7]>'
                      .'<link rel="stylesheet" href="'.$view->getStylepath().'/patch_'.$body.'.css" type="text/css" />'
//                    .'<link rel="stylesheet" href="'.$view->getThemepath().'/yaml/core/slim_iehacks.css" type="text/css" />'
                      .'<![endif]-->';
/*                    .'<!--[if lte IE 6]>'
//                    .'<script type="text/javascript" src="'.$view->getScriptpath().'/ie_minmax.js"></script>'
                      .'<style type="text/css">
                            img, div, a, input { behavior: url('.$view->getStylepath().'/iepngfix.htc) }
                        </style>'
//                    .'<script type="text/javascript" src="'.$view->getScriptpath().'/ie_pngfix_tilebg.js"></script>'
                      .'<![endif]-->
                       ';
*/
            break;

        case 'footer':
            // load the Theme styles in the very end of the page rendering
            // TODO pending review with PageUtil weight assignment (when implemented)
            if ($btconfig['optimize'] == '1') {
                // do not load the layout_* stylesheet and load the basic styles directly
                PageUtil::addVar('stylesheet', $view->getThemepath().'/yaml/core/slim_base.css');
                PageUtil::addVar('stylesheet', $view->getStylepath().'/basemod.css');
                PageUtil::addVar('stylesheet', $view->getStylepath().'/content.css');
                // TODO rtl-support load yaml/add-ons/rtl-support/core/base-rtl.css with the respective basemod-rtl.css and content-rtl.css
            } else {
                PageUtil::addVar('stylesheet', $view->getStylepath()."/layout_{$body}.css");
            }
            break;

        /* Body ID */
        case 'bodyid':
            if ($view->getToplevelmodule()) {
                $output = 'bt_'.$view->getToplevelmodule();

            } elseif (!empty($current)) {
                $output = 'bt_'.$current;

            } else {
                $output = 'bt_staticpage';
            }
            break;

        /* First CSS level */
        case 'classesbody':
            // add a first level of CSS classes like current language, type parameter and body template in use with a 'bt_' prefix
            if (!empty($current)) {
                $output .= 'bt_'.$current.' ';
            }
            if ($btcssbody && isset($btcssbody[$body]) && $btcssbody[$body]) {
                $output .= $btcssbody[$body].' ';
            }
            $output .= 'bt_'.$body.' bt_type_'.$view->getType().' bt_lang_'.$view->getLanguage();
            break;

        /* Second CSS level */
        case 'classespage':
            // add a second level of CSS classes
            // add the current layout and enabled zones
            $output .= 'bt_'.str_replace('_', ' bt_', $layout);
            // add the current function name
            $output .= ' bt_func_'.$view->getFunc();
            break;

        /* Third CSS level */
        case 'classesinnerpage':
            // add a customized third level of CSS classes like specific parameters for specific modules
            /*
            switch ($view->getToplevelmodule()) {
                case 'Pages':
                    switch ($view->getFunc()) {
                        case 'display':
                            // Example: add the current pageid in a CSS class (bt_pageid_PID)
                            // note: this only works when using normal urls, shortURLs uses the title field
                            $output .= ' bt_pageid_'.FormUtil::getPassedValue('pageid');
                            break;
                    }
                    break;
                case 'Content':
                    switch ($view->getFunc()) {
                        case 'view':
                            // Example: add the current page category id in a CSS class (bt_contentcatpage_CID)
                            // works for normal and shortURLs
                            if (System::getVar('shorturls')) {
                                $urlname = $view->getRequest()->getGet()->get('name');
                                $pageId = ModUtil::apiFunc('Content', 'Page', 'solveURLPath', compact('urlname'));
                            } else {
                                $pageId = $view->getRequest()->getGet()->get('pid');
                            }
                            $page = ModUtil::apiFunc('Content', 'Page', 'getPage', array('id' => $pageId));
                            $output .= ' bt_contentcatpage_'.$page['categoryId'];
                    }
                    break;
            }
            */
            if (!isset($params['noempty']) || !$params['noempty']) {
                $output = !empty($output) ? $output : 'bt-empty';
            }
            break;
    }

    return $output;
}
/**
 * BlankTheme plugin to display the admin navigation menu.
 *
 * Available parameters:
 *  - id           (string) ID of wrapper div (default: 'nav_admin')
 *  - ulclass      (string) CSS class name of the UL (default: 'cssplay_prodrop')
 *  - current      (string) Current screen ID (optional)
 *  - currentclass (string) CSS class name of the current tab, list item (default: 'selected')
 *
 * Example:
 *  {bt_adminlinks id='myId' ulclass='myUlClass' current='config' currentclass='myActiveClass'}
 *
 * @author Mateo Tibaquirá [mateo]
 * @author Erik Spaan [espaan]
 * @since  08/11/2007
 *
 * @param array             $params All parameters passed to this function from the template.
 * @param Zikula_View_Theme &$view  Reference to the View_Theme object.
 *
 * @return string Admin menu output.
 */
function smarty_function_bt_adminlinks($params, Zikula_View_Theme &$view)
{
    $dom = ZLanguage::getThemeDomain('BlankTheme');

    $id      = isset($params['id']) ? $params['id'] : 'nav_admin';
    $ulclass = isset($params['ulclass']) ? $params['ulclass'] : 'cssplay_prodrop';
    $current = isset($params['current']) ? $params['current'] : '';
    $cclass  = isset($params['currentclass']) ? $params['currentclass'] : 'selected';

    /*** Build the menu-array ***/
    /* menu option: {id, translatable link text, link, array of sublinks} */
    $menu = array();

    /* Homepage link */
    $menu[] = array('home', __('Home', $dom), System::getHomepageURL());

    if (SecurityUtil::checkPermission('Admin::', '::', ACCESS_EDIT))
    {
        /* Config menu */
        // System basis
        $linkoptions = array(
                             array(null, __('Site settings', $dom),  ModUtil::url('Settings', 'admin', 'main'),
                                 array(
                                     array(null, __('Localization', $dom),  ModUtil::url('Settings', 'admin', 'multilingual')),
                                     array(null, __('HTML settings', $dom), ModUtil::url('SecurityCenter', 'admin', 'allowedhtml'))
                                 )
                             ),
                             array(null, __('Permissions', $dom),    ModUtil::url('Permissions', 'admin', 'main')),
                             array(null, __('Categories', $dom),     ModUtil::url('Categories', 'admin', 'main'),
                                 array(
                                     array(null, __('Category registry', $dom), ModUtil::url('Categories', 'admin', 'editregistry')),
                                     array(null, __('New category', $dom),      ModUtil::url('Categories', 'admin', 'newcat'))
                                 )
                             ),
                             array(null, __('Admin panel', $dom),    ModUtil::url('Admin', 'admin', 'main'),
                                 array(
                                     array(null, __('Settings', $dom), ModUtil::url('Admin', 'admin', 'modifyconfig')),
                                     array(null, __('Help', $dom),     ModUtil::url('Admin', 'admin', 'help'))
                                 )
                             ),
                             array(null, __('System mailer', $dom),  ModUtil::url('Mailer', 'admin', 'main')),
                             array(null, __('Search options', $dom), ModUtil::url('Search', 'admin', 'main')),
                       );
        // Legal
        if (ModUtil::available('Legal')) {
            $linkoptions[] = array(null, __('Legal settings', $dom), ModUtil::url('Legal', 'admin', 'main'));
        }

        $menu[] = array('config', __('Config', $dom),  '#', $linkoptions);


        /* System menu */
        // Search for installed hooks
        $linkoptions = array();

        if (ModUtil::available('EZComments')) {
            $linkoptions[] = array(null, __('Comments', $dom),  ModUtil::url('EZComments', 'admin', 'modifyconfig'));
        }
        if (ModUtil::available('MultiHook')) {
            $linkoptions[] = array(null, __('MultiHook', $dom), ModUtil::url('MultiHook', 'admin', 'modifyconfig'));
        }
        if (ModUtil::available('BBCode')) {
            $linkoptions[] = array(null, __('BBCode', $dom),    ModUtil::url('bbcode', 'admin', 'config'));
        }
        if (ModUtil::available('BBSmile')) {
            $linkoptions[] = array(null, __('Smilies', $dom),   ModUtil::url('bbsmile', 'admin', 'modifyconfig'));
        }
        if (ModUtil::available('Ratings')) {
            $linkoptions[] = array(null, __('Ratings', $dom),   ModUtil::url('Ratings', 'admin', 'modifyconfig'));
        }
        if (empty($linkoptions)) {
            $linkoptions[] = array(null, __('No known hooks are installed', $dom), '#');
        }

        $theme  = System::getVar('Default_Theme');
        $menu[] = array('system', __('System', $dom), '#',
                    array(
                        array(null, __('Extensions', $dom),             ModUtil::url('Extensions', 'admin', 'main'),
                            array(
                                array(null, __('System plugins', $dom), ModUtil::url('Extensions', 'admin', 'viewPlugins', array('systemplugins' => 1))),
                                array(null, __('Module plugins', $dom), ModUtil::url('Extensions', 'admin', 'viewPlugins'))
                            )
                        ),
                        array(null, __('Hooks', $dom), '#',
                            $linkoptions
                        ),
                        array(null, __('Blocks', $dom),               ModUtil::url('Blocks', 'admin', 'main'),
                            array(
                                array(null, __('New block', $dom),    ModUtil::url('Blocks', 'admin', 'newblock')),
                                array(null, __('New position', $dom), ModUtil::url('Blocks', 'admin', 'newposition'))
                            )
                        ),
                        array(null, __('Themes', $dom),                        ModUtil::url('Theme', 'admin', 'main')),
                        array(null, __('Security center', $dom),               ModUtil::url('SecurityCenter', 'admin', 'modifyconfig'),
                            array(
                                array(null, __('View IDS log', $dom),          ModUtil::url('SecurityCenter', 'admin', 'viewidslog')),
                                array(null, __('HTMLPurifier settings', $dom), ModUtil::url('SecurityCenter', 'admin', 'purifierconfig'))
                            )
                        )
                    )
                );

        // SysInfo check
        if (ModUtil::available('SysInfo')) {
            $menu[] = array(null, __('System information', $dom), ModUtil::url('SysInfo', 'admin', 'main'));
        }


        /* Users/Groups menu */
        // build the Users management submenu options
        $subusr   = array();

        $profileModule = System::getVar('profilemodule', '');
        if (!empty($profileModule) && ModUtil::available($profileModule)) {
            $subusr[] = array(null, __('Profile module', $dom), ModUtil::url($profileModule, 'admin', 'main'));
        }

        $subusr[] = array(null, __('Users settings', $dom), ModUtil::url('Users', 'admin', 'config'));
        $subusr[] = array(null, __('Import users', $dom), ModUtil::url('Users', 'admin', 'import'));
        $subusr[] = array(null, __('Export users', $dom), ModUtil::url('Users', 'admin', 'exporter'));

        $menu[] = array('users', __('Users', $dom), '#',
                    array(
                        array(null, __('Manage groups', $dom), ModUtil::url('Groups', 'admin', 'main'),
                            array(
                                array(null, __('Groups settings', $dom), ModUtil::url('Groups', 'admin', 'modifyconfig'))
                            )
                        ),
                        array(null, __('Manage users', $dom), ModUtil::url('Users', 'admin', 'main'),
                            $subusr
                        ),
                        array(null, __('Create user', $dom), ModUtil::url('Users', 'admin', 'newUser')),
                        array(null, __('Find users', $dom), ModUtil::url('Users', 'admin', 'search')),
                        array(null, __('Find and e-mail users', $dom), ModUtil::url('Users', 'admin', 'mailUsers'))
                    )
                );


        /* Common Utils */
        $linkoptions = array(
                           array(null, __("Edit default theme", $dom), ModUtil::url('Theme', 'admin', 'modify', array('themename' => $theme)))
                       );

        // File handling
        if (ModUtil::available('Files')) {
            $linkoptions[] = array(null, __('File manager', $dom), ModUtil::url('Files', 'admin', 'main'));
        }

        // WYSIWYG handling
        if (ModUtil::available('Scribite') || ModUtil::available('LuMicuLa')) {
            $subopt = array();
            if (ModUtil::available('Scribite')) {
                $subopt[] = array(null, 'Scribite', ModUtil::url('Scribite', 'admin', 'main'));
            }
            if (ModUtil::available('LuMicuLa')) {
                $subopt[] = array(null, 'LuMicuLa', ModUtil::url('LuMicuLa', 'admin', 'main'));
            }
        }
        if (isset($subopt)) {
            $linkoptions[] = array(null, __('WYSIWYG editors', $dom), '#', $subopt);
        }
        // Thumbnails handling
        if (ModUtil::available('Thumbnail')) {
            $linkoptions[] = array(null, __('Thumbnails', $dom), ModUtil::url('Thumbnail', 'admin', 'main'));
        }

        $menu[] = array('utils', __('Utils', $dom), '#', $linkoptions);


        /* Common Routines links */
        $token = SecurityUtil::generateCsrfToken(null, true);
        $linkoptions = array(
                           array(null, __('Template engine', $dom), ModUtil::url('Theme', 'admin', 'modifyconfig', array(), null, 'render_compile_dir'),
                               array(
                                   array(null, __('Delete compiled render templates', $dom), ModUtil::url('Theme', 'admin', 'render_clear_compiled', array('csrftoken' => $token))),
                                   array(null, __('Delete cached render templates', $dom),   ModUtil::url('Theme', 'admin', 'render_clear_cache', array('csrftoken' => $token)))
                               )
                           ),
                           array(null, __('Theme engine', $dom), ModUtil::url('Theme', 'admin', 'modifyconfig'),
                                array(
                                   array(null, __('Delete compiled theme templates', $dom), ModUtil::url('Theme', 'admin', 'clear_compiled', array('csrftoken' => $token))),
                                   array(null, __('Delete cached theme templates', $dom),   ModUtil::url('Theme', 'admin', 'clear_cache', array('csrftoken' => $token)))
                               )
                           ),
                           array(null, __('Clear combination cache', $dom), ModUtil::url('Theme', 'admin', 'clear_cssjscombinecache', array('csrftoken' => $token))),
                           array(null, __('Delete theme configurations', $dom), ModUtil::url('Theme', 'admin', 'clear_config', array('csrftoken' => $token)))
                       );

        if (ModUtil::available('SysInfo')) {
            $linkoptions[] = array(null, __('Filesystem check', $dom),       ModUtil::url('SysInfo', 'admin', 'filesystem'));
            $linkoptions[] = array(null, __('Temporary folder check', $dom), ModUtil::url('SysInfo', 'admin', 'ztemp'));
        }

        $menu[] = array('routines', __('Routines', $dom), '#', $linkoptions);
    }
    /* Permission Admin:: | :: | ACCESS_EDIT ends here */

    /* Create content menu */
    $linkoptions = array();

    // Content Modules
    if (ModUtil::available('Clip') && SecurityUtil::checkPermission('Clip::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('Clip Editor Panel', $dom), ModUtil::url('Clip', 'editor', 'main')),
                         array(null, __('Create publication type', $dom), ModUtil::url('Clip', 'admin', 'pubtype'))
                      );
        $linkoptions[] = array(null, __('Clip Admin Panel', $dom), ModUtil::url('Clip', 'admin', 'main'), $suboptions);
    }
    if (ModUtil::available('News') && (SecurityUtil::checkPermission('News::', '::', ACCESS_EDIT) || SecurityUtil::checkPermission('Stories::Story', '::', ACCESS_EDIT))) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('News', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('News', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add an article', $dom), ModUtil::url('News', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('Pages') && SecurityUtil::checkPermission('Pages::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('Pages', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('Pages', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a page', $dom), ModUtil::url('Pages', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('Content') && SecurityUtil::checkPermission('Content::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('Settings', $dom), ModUtil::url('Content', 'admin', 'settings'))
                      );
        $linkoptions[] = array(null, __('Edit contents', $dom), ModUtil::url('Content', 'edit', 'main'), $suboptions);
    }

    // Downloads modules
    if (ModUtil::available('MediaAttach') && SecurityUtil::checkPermission('MediaAttach::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('MediaAttach', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('MediaAttach', 'admin', 'main'))
                      );
        $linkoptions[] = array(null, __('Add a download', $dom), ModUtil::url('MediaAttach', 'admin', 'view', array(), null, 'myuploadform_switch'), $suboptions);
    }
    if (ModUtil::available('Downloads') && SecurityUtil::checkPermission('Downloads::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('Add category', $dom), ModUtil::url('Downloads', 'admin', 'category_menu')),
                         array(null, __('Settings', $dom),     ModUtil::url('Downloads', 'admin', 'main'))
                      );
        $linkoptions[] = array(null, __('Add a download', $dom), ModUtil::url('Downloads', 'admin', 'newdownload'), $suboptions);
    }

    // Community modules
    if (ModUtil::available('Polls') && SecurityUtil::checkPermission('Polls::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('Polls', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('Polls', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a poll', $dom), ModUtil::url('Polls', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('FAQ') && SecurityUtil::checkPermission('FAQ::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('FAQ', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('FAQ', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a FAQ', $dom), ModUtil::url('FAQ', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('Feeds') && SecurityUtil::checkPermission('Feeds::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('Feeds', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('Feeds', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a feed', $dom), ModUtil::url('Feeds', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('Reviews') && SecurityUtil::checkPermission('Reviews::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('Reviews', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('Reviews', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a review', $dom), ModUtil::url('Reviews', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('WebLinks') && SecurityUtil::checkPermission('Web_Links::', '::', ACCESS_EDIT)) {
        $linkoptions[] = array(null, __('Add a web link', $dom), ModUtil::url('WebLinks', 'admin', 'main', array('op' => 'LinksAddLink')));
    }

    // Calendar modules
    if (ModUtil::available('TimeIt') && SecurityUtil::checkPermission('TimeIt::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('Settings', $dom), ModUtil::url('TimeIt', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a calendar event', $dom), ModUtil::url('TimeIt', 'admin', 'new'), $suboptions);
    }
    if (ModUtil::available('crpCalendar') && SecurityUtil::checkPermission('crpCalendar::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('crpCalendar', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('crpCalendar', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add a calendar event', $dom), ModUtil::url('crpCalendar', 'admin', 'new'), $suboptions);
    }

    // Legacy modules
    if (ModUtil::available('AdminMessages') && SecurityUtil::checkPermission('AdminMessages::', '::', ACCESS_EDIT)) {
        $suboptions = array(
                         array(null, __('View list', $dom), ModUtil::url('AdminMessages', 'admin', 'view')),
                         array(null, __('Settings', $dom),  ModUtil::url('AdminMessages', 'admin', 'modifyconfig'))
                      );
        $linkoptions[] = array(null, __('Add an admin message', $dom), ModUtil::url('AdminMessages', 'admin', 'new'), $suboptions);
    }

    if (!$linkoptions) {
        $linkoptions[] = array(null, __('No known modules are installed', $dom), '#');
    }

    $menu[] = array('content', __('Create content', $dom), '#', $linkoptions);

    /* Logout link */
    $menu[] = array('logout', __('Log out', $dom), ModUtil::url('Users', 'user', 'logout'));



    /* Create the menu based on the array above */
    $output  = '<div id="'.$id.'"><ul' . ((!empty($ulclass))?' class="'.$ulclass.'"':'') . '>';
    foreach ($menu as $option) {
        $output .= bt_adminlinks_drawmenu($option, $current, $cclass);
    }
    $output .= '</ul></div>';

    return $output;
}
Esempio n. 6
0
<?php 
/**
 * Zikula Application Framework
 *
 * @copyright (c) 2007-2012 Mateo Tibaquirá
 * @link      http://www.blanktheme.org
 * @license   GNU/GPL - http://www.gnu.org/copyleft/gpl.html
 * @abstract  Blank theme to develop new themes with ease
 */


$dom = ZLanguage::getThemeDomain('BlankTheme');

$themeversion['name']           = 'BlankTheme';
$themeversion['displayname']    = __('BlankTheme', $dom);
$themeversion['description']    = __('Theme development framework for Zikula', $dom);
$themeversion['version']        = '1.3';

$themeversion['author']         = 'BlankTheme Team';
$themeversion['contact']        = 'http://www.blanktheme.org';
$themeversion['admin']          = 1;
$themeversion['user']           = 1;
$themeversion['system']         = 0;
$themeversion['changelog']      = 'docs/changelog.txt';
$themeversion['credits']        = 'docs/credits.txt';
$themeversion['help']           = 'docs/help.txt';
$themeversion['license']        = 'docs/license.txt';
$themeversion['xhtml']          = true;

$themeversion['extra']          = array('BlankTheme' => '1.3',
                                        'YAML'       => '3.3.1');
Esempio n. 7
0
 /**
  * Build a new instance.
  */
 public function __construct($bundle)
 {
     $this->name = $bundle->getName();
     $this->baseDir = $bundle->getPath();
     $this->domain = ZLanguage::getThemeDomain($this->name);
     Zikula_ClassProperties::load($this, $this->getMetaData());
 }
Esempio n. 8
0
    /**
     * Retrieves the theme domain
     *
     * @param string $themename Name of the theme to parse
     */
    public function _getthemedomain($themename)
    {
        if (in_array($themename, array('Andreas08', 'Atom', 'Printer', 'RSS', 'SeaBreeze'))) {
            return 'zikula';
        }

        return ZLanguage::getThemeDomain($themename);
    }