Exemplo n.º 1
0
/**
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @package Global
 * @license http://opensource.org/licenses/lgpl-3.0.html
 */
function select2Script()
{
    $script = '<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'javascript/select2/select2.min.js"></script>';
    \Layout::addJSHeader($script);
    \Layout::addToStyleList('javascript/select2/select2.min.css');
    \Layout::addToStyleList('javascript/select2/select2-bootstrap.css');
}
Exemplo n.º 2
0
 public static function importStyleSheets()
 {
     if (isset($_SESSION['Layout_Settings']->_style_sheets)) {
         foreach ($_SESSION['Layout_Settings']->_style_sheets as $css) {
             Layout::addToStyleList($css);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Returns a menu and its links for display
  */
 public function view($admin = false)
 {
     $key = Key::getCurrent();
     if ($key && $key->isDummy(true)) {
         return;
     }
     $theme_tpl_dir = \PHPWS_Template::getTplDir('menu') . 'menu_layout/';
     $menu_tpl_dir = PHPWS_SOURCE_DIR . 'mod/menu/templates/menu_layout/';
     $theme_path = $theme_tpl_dir . $this->template . '/';
     $menu_path = $menu_tpl_dir . $this->template . '/';
     if (is_file($theme_path . 'menu.tpl')) {
         $file = $theme_path . 'menu.tpl';
         $path = $theme_path;
         $http = 'themes/' . Layout::getTheme() . '/templates/menu/menu_layout/' . $this->template . '/';
     } elseif (is_file($menu_path . 'menu.tpl')) {
         $file = $menu_path . 'menu.tpl';
         $path = $menu_path;
         $http = 'mod/menu/templates/menu_layout/' . $this->template . '/';
     } else {
         $this->template = 'basic';
         $this->save();
         $path = $menu_tpl_dir . 'basic/';
         $http = 'mod/menu/templates/menu_layout/basic/';
         $file = $path . '/menu.tpl';
     }
     $this->parseIni($path);
     if ($this->_style) {
         $style = $http . 'style.css';
         Layout::addToStyleList($style);
     }
     $tpl['TITLE'] = $this->getTitle();
     $tpl['LINKS'] = $this->displayLinks($admin);
     $tpl['MENU_ID'] = sprintf('menu-%s', $this->id);
     $content = PHPWS_Template::process($tpl, 'menu', $file, true);
     return $content;
 }