Esempio n. 1
0
 /**
  * Creates the help input
  *
  * @return  JFormField  Formatted input
  */
 protected function getInput()
 {
     JHTML::_('behavior.modal');
     $doc = JFactory::getDocument();
     $template = $this->form->getValue('template');
     if (file_exists(JPATH_ROOT . '/templates/' . $template . '/wrighttemplate.php')) {
         require_once JPATH_ROOT . '/templates/' . $template . '/wrighttemplate.php';
         $wrightTemplate = WrightTemplate::getInstance();
         $html = '<a class="modal" href="' . $wrightTemplate->documentationLink . '" rel="{\'handler\': \'iframe\', \'size\': {x: 800, y:600}}">' . JText::_('TPL_JS_WRIGHT_FIELD_DOCUMENTATION') . '</a>';
         // Refresh CSS cache since we are editing params
         if (is_file(JPATH_ROOT . '/templates' . '/' . $template . '/css' . '/' . $template . '.css')) {
             JFile::delete(JPATH_ROOT . '/templates' . '/' . $template . '/css' . '/' . $template . '.css');
         }
         return $html;
     }
     return '';
 }
Esempio n. 2
0
if (preg_match('/nav\\-stacked/', $class_sfx) || preg_match('/nav\\-list/', $class_sfx)) {
    $wrightCollapseMenus = true;
    $menuType = 'vertical';
}
if (preg_match('/tabbable/', $params->get('moduleclass_sfx'))) {
    $wrightCollapseMenus = true;
    $menuType = 'vertical';
}
if (preg_match('/navbar/', $params->get('moduleclass_sfx'))) {
    $wrightCollapseMenus = false;
    $menuType = 'horizontal';
}
if (preg_match('/no\\-collapse/', $class_sfx)) {
    $wrightCollapseMenus = false;
} else {
    $wrightTemplate = WrightTemplate::getInstance();
    if (in_array($module->position, $wrightTemplate->menuPositions)) {
        $wrightCollapseMenus = false;
        $menuType = 'horizontal';
    }
}
/* End Wright v.3: Distinguish collapsible and non-collapsible menus */
$navlist = '';
if ($menuType == 'vertical') {
    if ($class_sfx == '') {
        $navlist = ' nav-list';
    } elseif ($class_sfx == ' no-collapse') {
        $navlist = ' nav-list';
    }
}
?>
Esempio n. 3
0
 /**
  *  Sets up the main columns (main and sidebars)
  *
  * @return  string
  */
 private function setupColumns()
 {
     $doc = Wright::getInstance();
     // Get our column info straight
     $main = 0;
     $check = 0;
     $number = 0;
     $layout = array();
     $wrightTemplate = null;
     $editmode = false;
     // Check editing mode
     if (JRequest::getVar('task') == 'edit' || JRequest::getVar('layout') == 'form' || JRequest::getVar('layout') == 'edit') {
         $editmode = true;
     } else {
     }
     if (class_exists("WrightTemplate") && !$editmode) {
         $wrightTemplate = WrightTemplate::getInstance();
         // Checks if the template has full height sidebars for adding the tag for the columns (sidebars)
         if (property_exists("WrightTemplate", "fullHeightSidebars")) {
             if ($wrightTemplate->fullHeightSidebars) {
                 $this->tags['fullHeightColumns'] = '/(.*)<div class="container_12" id="columnscontainer">(.*)<\\/div><div id="columnscontainer_close"><\\/div>(.*)$/isU';
             }
         }
     } else {
     }
     foreach (explode(';', $doc->document->params->get('columns', 'sidebar1:3;main:6;sidebar2:3')) as $item) {
         list($col, $val) = explode(':', $item);
         if ($col !== 'main' && $check == 0) {
             $main++;
         } else {
             $check = 1;
         }
         $this->columns[$col] = new JObject();
         $this->columns[$col]->name = $col;
         $this->columns[$col]->size = $val;
         $this->columns[$col]->push = 0;
         $this->columns[$col]->pull = 0;
         $this->columns[$col]->check = $check;
         // Contains if column really exists into content or not
         $this->columns[$col]->exists = false;
         $number++;
         if ($val > 0 && $doc->document->countModules($col) || $col == 'main') {
             $layout[] = $col;
         } else {
             // Addition for forcing a sidebar (if it is a template which must have a sidebar for some of its positions)
             if ($wrightTemplate) {
                 if (property_exists("WrightTemplate", "forcedSidebar")) {
                     $wrightTemplate = WrightTemplate::getInstance();
                     if ($col == $wrightTemplate->forcedSidebar) {
                         $layout[] = $col;
                     }
                 }
             }
         }
     }
     // Auto set to full width if editing
     if (JRequest::getVar('task') == 'edit' || JRequest::getVar('layout') == 'form') {
         $layout = array();
         $layout[] = 'main';
     }
     switch (implode('-', $layout)) {
         case 'main':
             $this->columns['main']->size = 12;
             $this->cols = 'wide';
             break;
         case 'main-sidebar1':
             $this->columns['main']->size = 12 - $this->columns['sidebar1']->size;
             $this->cols = 'm_' . $this->columns['main']->size . '_' . $this->columns['sidebar1']->size;
             break;
         case 'sidebar1-main':
             $this->columns['main']->size = 12 - $this->columns['sidebar1']->size;
             $this->columns['sidebar1']->pull = $this->columns['main']->size;
             $this->columns['main']->push = $this->columns['sidebar1']->size;
             $this->cols = 'l_' . $this->columns['main']->size;
             break;
         case 'main-sidebar2':
             $this->columns['main']->size = 12 - $this->columns['sidebar2']->size;
             $this->cols = 'm_' . $this->columns['main']->size . '_r_' . $this->columns['sidebar2']->size;
             break;
         case 'sidebar2-main':
             $this->columns['main']->size = 12 - $this->columns['sidebar2']->size;
             $this->columns['sidebar2']->pull = $this->columns['main']->size;
             $this->columns['main']->push = $this->columns['sidebar2']->size;
             $this->cols = 'l_' . $this->columns['main']->size;
             break;
         case 'main-sidebar1-sidebar2':
             $this->cols = 'm_' . $this->columns['sidebar1']->size . '_' . $this->columns['sidebar2']->size;
             break;
         case 'main-sidebar2-sidebar1':
             $this->columns['sidebar2']->pull = $this->columns['sidebar1']->size;
             $this->columns['sidebar1']->push = $this->columns['sidebar2']->size;
             $this->cols = 'm_' . $this->columns['sidebar2']->size . '_' . $this->columns['sidebar1']->size;
             break;
         case 'sidebar2-main-sidebar1':
             $this->columns['main']->push = $this->columns['sidebar2']->size;
             $this->columns['sidebar2']->pull = $this->columns['main']->size + $this->columns['sidebar1']->size;
             $this->columns['sidebar1']->push = $this->columns['sidebar2']->size;
             $this->cols = $this->columns['sidebar2']->size . '_m_' . $this->columns['sidebar1']->size;
             break;
         case 'sidebar1-main-sidebar2':
             $this->columns['main']->push = $this->columns['sidebar1']->size;
             $this->columns['sidebar1']->pull = $this->columns['main']->size;
             $this->cols = $this->columns['sidebar1']->size . '_m_' . $this->columns['sidebar2']->size;
             break;
         case 'sidebar1-sidebar2-main':
             $this->columns['main']->push = $this->columns['sidebar1']->size + $this->columns['sidebar2']->size;
             $this->columns['sidebar2']->pull = $this->columns['main']->size;
             $this->columns['sidebar1']->pull = $this->columns['main']->size;
             $this->cols = $this->columns['sidebar1']->size . '_' . $this->columns['sidebar2']->size . '_m';
             break;
         case 'sidebar2-sidebar1-main':
             $this->columns['main']->push = $this->columns['sidebar1']->size + $this->columns['sidebar2']->size;
             $this->columns['sidebar2']->pull = $this->columns['main']->size + $this->columns['sidebar1']->size;
             $this->columns['sidebar1']->pull = $this->columns['main']->size - $this->columns['sidebar2']->size;
             $this->cols = 'l_' . $this->columns['sidebar2']->size . '_r_' . $this->columns['sidebar1']->size . '_m_' . $this->columns['main']->size;
             break;
     }
 }