Beispiel #1
0
 public static function load_style($module, $params)
 {
     $doc = JFactory::getDocument();
     //set moduleid
     $module_id = XEFUtility::getModuleId($module, $params);
     $moduleId = '#' . $module_id;
     $moduleClass = '.' . $module_id;
     $scrollerLayout = $params->get('scroller_layout');
     /*
      * module unique id will only assign on horizontl style. 
      * this unique class will only use for navigation arrow styling
      * vertical style will auto adjuct arrow position to middle using css file.
      */
     $selectorClass = $scrollerLayout == 'basic_h' ? '.' . $moduleId : '';
     //scroller wrapper widtha nd height. this width and height will effect on .pane class also.
     $moduleWidth = $paneWidth = (int) $params->get('module_width');
     $moduleHeight = (int) $params->get('mod_height');
     /*
      * In horizontal style item width will calculated by persentage value
      * In vertical style item height will calculate on module height and num of columns
      */
     if ($scrollerLayout == 'basic_h') {
         $itemDimensions = 'width:' . 100 / (int) $params->get('col_amount') . '%';
     } else {
         $itemDimensions = 'width: 100%; height:' . $moduleHeight / $params->get('col_amount') . 'px';
     }
     $controlMargin = $params->get('control_margin');
     //items div always higher value thats way we will check animatin style and determine the proper css property
     $animationStyle = $params->get('animation_style') == 'animation_h' ? 'width' : 'height';
     //preaper all css settings
     $css = "\n            {$moduleId} {height: {$moduleHeight}px;}\n\n            {$moduleId} .items { {$animationStyle}:20000em; }\n            {$moduleId} .pane .item{{$itemDimensions}; overflow:hidden; }\n\n            {$moduleClass} a.browse{ margin:{$controlMargin}; }\n            \n        ";
     //push this css on document head
     $doc->addStyleDeclaration($css);
 }
Beispiel #2
0
 public static function loadScripts($module, $params)
 {
     $doc = JFactory::getDocument();
     // Set moduleid
     $module_id = XEFUtility::getModuleId($module, $params);
     // Load jQuery form framework
     XEFUtility::addjQuery($module, $params);
     $js = "jQuery(#{$module_id}).collapse();";
     //$doc->addScriptDeclaration($js);
     if (!defined('XPERT_ACCORDION')) {
         //add tab engine js file
         $doc->addScript(JURI::root(true) . '/modules/mod_xpertaccordion/assets/js/xpertaccordion.js');
         define('XPERT_ACCORDION', 1);
     }
 }
Beispiel #3
0
 public static function generateTabs($tabs, $list, $params, $module)
 {
     $module_id = XEFUtility::getModuleId($module, $params);
     $title_type = $params->get('tabs_title_type');
     $position = $params->get('tabs_position', 'top');
     $html = array();
     $icons = explode(',', (string) $params->get('faicon'));
     if ($title_type == 'custom') {
         $titles = explode(",", $params->get('tabs_title_custom'));
     }
     if ($tabs == 0 or $tabs > count($list)) {
         $tabs = count($list);
     }
     $html[] = '<ul class="txtabs-nav ' . $position . ' clearfix">';
     for ($i = 0; $i < $tabs; $i++) {
         if ($list[$i]->introtext != NULL) {
             // li and a classes
             $class = '';
             $aclass = '';
             if (!$i) {
                 $class = 'first active';
                 //$aclass = 'active';
             }
             if ($i == $tabs - 1) {
                 $class = 'last';
             }
             if ($title_type == 'custom') {
                 $title = isset($titles[$i]) ? $titles[$i] : '';
             } else {
                 $title = $list[$i]->title;
             }
             $html[] = '<li class="' . $class . '">';
             $html[] = '<a data-toggle="tab" data-target="#' . $module_id . '-' . $i . '">';
             $html[] = '<i class="' . $icons[$i] . '"></i>';
             $html[] = "<span>{$title}</span>";
             $html[] = '</a>';
             $html[] = '</li>';
         }
     }
     $html[] = '</ul>';
     return implode("\n", $html);
 }
Beispiel #4
0
    case 'joomla':
        $cat_ids = $params->get('jom_catid');
        $cat_field = 'jom_catid';
        break;
    case 'k2':
        $cat_ids = $params->get('k2_catid');
        $cat_field = 'k2_catid';
        break;
    case 'easyblog':
        $cat_ids = $params->get('eb_catid');
        $cat_field = 'eb_catid';
        break;
    default:
        $cat_ids = $params->get('jom_catid');
        $cat_field = 'eb_catid';
        break;
}
// Populate items
foreach ($cat_ids as $id) {
    $instance->set($cat_field, array($id));
    $items[] = $instance->getItems();
}
// Load Stylesheet file
XEFUtility::loadStyleSheet($module, $params);
// Load Module specific script
XEFXpertGalleryHelper::loadScript($module, $params);
// Load Module specific style defination
//XEFXpertScrollerHelper::load_style($module, $params);
// Assign some variable to use inside views
$overview_elements = $params->get('overview_elements');
require JModuleHelper::getLayoutPath($module->module, $params->get('layout', 'default'));
Beispiel #5
0
 public function getImage($item)
 {
     return XEFUtility::getImage($item->intro);
 }
Beispiel #6
0
 public function prepareItems($items)
 {
     //$source = $this->get('content_source');
     foreach ($items as $item) {
         // Clean title
         $item->title = JFilterOutput::ampReplace($item->title);
         // Category name & link
         $item->catname = $this->getCategory($item);
         $item->catlink = $this->getCategoryLink($item);
         // Link
         $item->link = $this->getLink($item);
         // Image
         $item->image = $this->getImage($item);
         // Date
         $item->date = $this->getDate($item);
         // Set image dimension
         $dimensions = array('width' => $this->get('image_width', 400), 'height' => $this->get('image_height', 300));
         // If thumbnail is enable set its property
         if ($this->get('navigation') == 'thumb' or $this->get('thumb')) {
             $thumb_dimensions = array('width' => $this->get('thumb_width', 100), 'height' => $this->get('thumb_height', 100));
             $item->thumb = XEFUtility::getResizedImage($item->image, $thumb_dimensions, $this->module, '_thumb');
         }
         // Finally re-sized image if image re-sizer is on
         if ($this->get('image_resize')) {
             $item->image = XEFUtility::getResizedImage($item->image, $dimensions, $this->module);
         }
         // Intro text
         $filter_by = $this->get('intro_limit_type');
         // Trim intro text based on filter type
         if ($filter_by == 'words') {
             $item->introtext = XEFUtility::wordLimit($item->introtext, $this->get('intro_limit', 100));
         } elseif ($filter_by == 'chars') {
             $item->introtext = XEFUtility::characterLimit($item->introtext, $this->get('intro_limit', 100));
         }
     }
     return $items;
 }
Beispiel #7
0
 public function getImage($item)
 {
     $path = '';
     //Take advantage from joomla default Intro image system
     if (isset($item->images)) {
         $images = json_decode($item->images);
     }
     if (isset($images->image_intro) and !empty($images->image_intro)) {
         $path = $images->image_intro;
     } else {
         //get image from article intro text
         $path = XEFUtility::getImage($item->introtext);
     }
     return $path;
 }
Beispiel #8
0
 public function getImage($item)
 {
     return XEFUtility::getK2Images($item->id, $item->title, $item->introtext);
 }