public function onShowFrontGallery($options) { $this->options = $options; if ($this->options['theme'] != $this->name) { return null; } $doc = JFactory::getDocument(); $params = JComponentHelper::getParams('com_droppics'); $scripts = array(); $stylesheets = array(); $stylesheets[] = JURI::base('true') . '/plugins/droppics/bxslider/style.css'; $stylesheets[] = JURI::base('true') . '/plugins/droppics/bxslider/jquery.bxslider.css'; $scripts[] = JURI::base('true') . '/plugins/droppics/bxslider/jquery.bxslider.min.js'; $scripts[] = JURI::base('true') . '/plugins/droppics/bxslider/script.js'; $headLoading = ''; if ($this->options['from_plugin'] === true) { $doc->addScript(JURI::base('true') . '/components/com_droppics/assets/js/droppicsHelper.js'); if ($params->get('jquerybase', true)) { JLoader::register('DroppicsBase', JPATH_ADMINISTRATOR . '/components/com_droppics/classes/droppicsBase.php'); if (droppicsBase::isJoomla30()) { JHtml::_('jquery.framework'); } else { $doc->addScript(JURI::base('true') . '/components/com_droppics/assets/js/jquery-1.8.3.js'); $doc->addScript(JURI::base('true') . '/components/com_droppics/assets/js/jquery-noconflict.js'); } } foreach ($scripts as $script) { $doc->addScript($script); } foreach ($stylesheets as $stylesheet) { $doc->addStyleSheet($stylesheet); } } else { $files = array(); foreach ($scripts as $script) { $files[] = '["' . $script . '","js"]'; } foreach ($stylesheets as $stylesheet) { $files[] = '["' . $stylesheet . '","css"]'; } $files = implode(',', $files); $headLoading .= "loadHeadFiles('[" . $files . "]');"; } $content = ""; $pager = ""; $ij = 0; if (!empty($this->options['pictures']) || !empty($this->options['categories'])) { $content .= '<div id="droppicsgallery' . $this->options['id_gallery'] . '" class="droppicsgallerybxslider droppicsgallery" data-shownav="' . droppicsBase::loadValue($options['params'], 'bxslider_show_nav', '1') . '" data-showbotnav="' . droppicsBase::loadValue($options['params'], 'bxslider_show_bottom_nav', '2') . '" data-autostart="' . droppicsBase::loadValue($options['params'], 'bxslider_autostart', '1') . '" data-pause="' . droppicsBase::loadValue($options['params'], 'bxslider_pause', '4000') . '" data-mode="' . droppicsBase::loadValue($options['params'], 'bxslider_mode', '0') . '" data-adaptive="' . droppicsBase::loadValue($options['params'], 'bxslider_adaptive_height', '0') . '">'; if (!empty($this->options['pictures'])) { $content .= '<div class="bxSlider">'; //$total = count($this->options['pictures']); foreach ($this->options['pictures'] as $picture) { $pparams = json_decode($picture->picture_params); //$group = ($ij > 0 && $ij < $total) ? 'rel="group_'.$this->options['id_gallery'].'"' : ''; $group = 'rel="group_' . $this->options['id_gallery'] . '"'; $content .= '<div class="wimg">'; $content .= '<a class="set-modal" ' . $group . ' href="' . COM_MEDIA_BASEURL . '/com_droppics/' . $picture->id_gallery . '/' . $picture->file . '" data-modal-title="Galeria"><img src="' . COM_MEDIA_BASEURL . '/com_droppics/' . $picture->id_gallery . '/' . $picture->file . '" alt="' . $picture->alt . '" title="' . $picture->title . '" data-thumb="' . COM_MEDIA_BASEURL . '/com_droppics/' . $picture->id_gallery . '/thumbnails/' . $picture->file . '"/></a>'; if (droppicsBase::loadValue(@$this->options['params'], 'bxslider_show_bottom_nav', '2') == '2') { $pager .= '<a data-slide-index="' . $ij . '" href=""><img src="' . COM_MEDIA_BASEURL . '/com_droppics/' . $picture->id_gallery . '/thumbnails/' . $picture->file . '" alt="' . $picture->alt . '" title="' . $picture->title . '" /></a>'; } if (trim(droppicsBase::loadValue($pparams, 'bxslider_image_html', '')) !== '') { $content .= '<div class="bxsliderhtml" style="' . ' top: ' . droppicsBase::loadValue($pparams, 'bxslider_image_top', '80') . '%;' . ' left: ' . droppicsBase::loadValue($pparams, 'bxslider_image_left', '0') . '%;' . ' width: ' . droppicsBase::loadValue($pparams, 'bxslider_image_width', '100') . '%;' . ' height: ' . droppicsBase::loadValue($pparams, 'bxslider_image_height', '20') . '%;' . ' background-color: ' . $this->hex2rgba(droppicsBase::loadValue($pparams, 'bxslider_image_bgcolor', 'transparent'), droppicsBase::loadValue($pparams, 'bxslider_image_transparency', '90') / 100) . ';' . ' ">' . droppicsBase::loadValue($pparams, 'bxslider_image_html', '') . '</div>'; } $content .= '</div>'; $ij++; } $content .= '</div>'; $content .= '<div class="clr"></div>'; if ($pager !== '') { $content .= '<div id="bx-pager" class="bx-pager-images">'; $content .= $pager; $content .= '</div>'; } } if ((!empty($this->options['categories']) || !empty($this->options['parent'])) && droppicsBase::loadValue($options['params'], 'bxslider_show_subcategories', '0')) { $content .= '<div class="droppicscats">'; $content .= '<h2>' . JText::_('COM_DROPPICS_SUBCGALLERIES') . '</h2>'; if (!empty($this->options['parent'])) { if ($this->options['parent']->id_picture === null) { $params = JComponentHelper::getParams('com_droppics'); $src = JURI::base() . $params->get('catimage', null); $alt = $this->options['parent']->category_title; $title = ''; } else { $src = COM_MEDIA_BASEURL . '/com_droppics/' . $this->options['parent']->id_category . '/thumbnails/' . $this->options['parent']->picture_file; $title = $this->options['parent']->picture_title; $alt = $this->options['parent']->picture_alt; } $content .= '<div class="wcat wimg wparent">'; $content .= '<a class="droppicscatslink" data-id="' . $this->options['parent']->id_category . '" href="" >'; $content .= '<img class="img" src="' . $src . '" alt="' . $alt . '" title="' . $title . '" />'; $content .= '</a>'; $content .= '<span>' . JText::_('COM_DROPPICS_BACK_TO') . ' ' . $this->options['parent']->category_title . '</span>'; $content .= '</div>'; $content .= '<div class="clr"></div>'; } foreach ($this->options['categories'] as $category) { $content .= '<div class="wcat wimg">'; $content .= '<a class="droppicscatslink" data-id="' . $category->id_category . '" href="' . COM_MEDIA_BASEURL . '/com_droppics/' . $category->id_category . '/' . $category->picture_file . '" >'; $content .= '<img class="img" src="' . COM_MEDIA_BASEURL . '/com_droppics/' . $category->id_category . '/thumbnails/' . $category->picture_file . '" alt="' . $category->picture_alt . '" title="' . $category->picture_title . '" />'; $content .= '</a>'; $content .= '<span>' . $category->category_title . '</span>'; $content .= '</div>'; } $content .= '</div>'; $content .= '<div class="clr"></div>'; } if (empty($this->options['categories']) && empty($this->options['parent']) && $this->options['from_plugin'] === true) { //Include style in the head with joomla $this->addStyleDeclaration(@$this->options, false); } else { //Include style in the head dynamically $headLoading .= $this->addStyleDeclaration(@$this->options, true); } if ($headLoading !== '') { $headLoading = '<script type="text/javascript">' . $headLoading . '</script>'; } $content .= $headLoading; $content .= '</div>'; } return $content; }
JText::script('COM_DROPPICS_JS_CONFIRM'); JText::script('COM_DROPPICS_JS_SAVE'); JText::script('COM_DROPPICS_JS_SAVED'); $doc = JFactory::getDocument(); $doc->addScriptDeclaration('gcaninsert=' . (JRequest::getBool('caninsert', false) ? 'true' : 'false') . ';'); $doc->addScriptDeclaration('e_name="' . JRequest::getString('e_name') . '";'); $collapse = DroppicsBase::getParam('catcollapsed', 0); $declaration = " if(typeof(Droppics)=='undefined'){" . " Droppics={};" . "}" . "Droppics.can = {};" . "Droppics.can.create=" . (int) $this->canDo->get('core.create') . ";" . "Droppics.can.edit=" . (int) ($this->canDo->get('core.edit') || $this->canDo->get('core.edit.own')) . ";" . "Droppics.can.delete=" . (int) $this->canDo->get('core.delete') . ";" . "Droppics.baseurl='" . COM_MEDIA_BASEURL . "';" . "Droppics.collapse=" . ($collapse ? 'true' : 'false') . ";" . "Droppics.version='" . droppicsComponentHelper::getVersion() . "';" . ""; $doc->addScriptDeclaration($declaration); $ownbootstrap = ''; if (JFactory::getApplication()->isSite() || !droppicsBase::isJoomla30()) { $ownbootstrap = 'ownbootstrap'; } ?> <div id="mybootstrap" class="<?php if (droppicsBase::isJoomla30()) { echo 'joomla30'; } else { echo 'joomla25'; } ?> <?php echo $ownbootstrap; ?> "> <div id="main_wrapper"> <?php echo $this->loadTemplate('cats'); ?> <div id="rightcol" class="">