function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $path = PhocaGalleryPath::getPath(); $this->tmpl['avatarpathabs'] = $path->avatar_abs . DS . 'thumbs' . DS . 'phoca_thumb_s_'; $this->tmpl['avatarpathrel'] = $path->avatar_rel . 'thumbs/phoca_thumb_s_'; $this->tmpl['avtrpathrel'] = $path->avatar_rel; JHTML::stylesheet('administrator/components/com_phocagallery/assets/phocagallery.css'); $document =& JFactory::getDocument(); $document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1)); // Button JHTML::_('behavior.modal', 'a.modal_phocagalleryusers'); $this->button = new JObject(); $this->button->set('modal', true); $this->button->set('methodname', 'modal-button'); //$this->button->set('link', $link); $this->button->set('text', JText::_('COM_PHOCAGALLERY_DISPLAY_IMAGE_DETAIL')); //$this->button->set('name', 'image'); $this->button->set('modalname', 'modal_phocagalleryusers'); $this->button->set('options', "{handler: 'image', size: {x: 200, y: 150}}"); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
public function display($tpl = null) { $this->state = $this->get('State'); $this->form = $this->get('Form'); $this->item = $this->get('Item'); JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css'); $params = JComponentHelper::getParams('com_phocagallery'); $this->tmpl['enablethumbcreation'] = $params->get('enable_thumb_creation', 1); $this->tmpl['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int) $this->tmpl['enablethumbcreation']); if ($this->item->extlink1 != '') { $extLink = PhocaGalleryRenderAdmin::renderExternalLink($this->item->extlink1); $this->form->setValue('extlink1link', '', $extLink[0]); $this->form->setValue('extlink1title', '', $extLink[1]); $this->form->setValue('extlink1target', '', $extLink[2]); $this->form->setValue('extlink1icon', '', $extLink[3]); } if ($this->item->extlink2 != '') { $extLink = PhocaGalleryRenderAdmin::renderExternalLink($this->item->extlink2); $this->form->setValue('extlink2link', '', $extLink[0]); $this->form->setValue('extlink2title', '', $extLink[1]); $this->form->setValue('extlink2target', '', $extLink[2]); $this->form->setValue('extlink2icon', '', $extLink[3]); } $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); // Preprocess the list of items to find ordering divisions. foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } /* * We need to load all items because of creating tree * After creating tree we get info from pagination * and will set displaying of categories for current pagination * E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to 10 will be displayed */ if (!empty($this->items)) { $text = ''; // text is tree name e.g. Category >> Subcategory $tree = array(); $this->items = $this->processTree($this->items, $tree, 0, $text, -1, 0); } //$mainframe = JFactory::getApplication(); //$document = JFactory::getDocument(); //$uri = JFactory::getURI(); $this->tmpl['notapproved'] = $this->get('NotApprovedCategory'); JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css'); $document = JFactory::getDocument(); //$document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1)); $params = JComponentHelper::getParams('com_phocagallery'); $this->tmpl['enablethumbcreation'] = $params->get('enable_thumb_creation', 1); $this->tmpl['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int) $this->tmpl['enablethumbcreation']); $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); // Preprocess the list of items to find ordering divisions. foreach ($this->items as &$item) { $this->ordering[$item->catid][] = $item->id; } $this->processImages(); JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css'); $document = JFactory::getDocument(); //$document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1)); $params = JComponentHelper::getParams('com_phocagallery'); $this->tmpl['enablethumbcreation'] = $params->get('enable_thumb_creation', 1); $this->tmpl['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int) $this->tmpl['enablethumbcreation']); /*$app = JFactory::getApplication(); $uri = JFactory::getURI(); $db = JFactory::getDBO();*/ $this->tmpl['notapproved'] = $this->get('NotApprovedImage'); // Button JHTML::_('behavior.modal', 'a.modal_phocagalleryimgs'); $this->button = new JObject(); $this->button->set('modal', true); $this->button->set('methodname', 'modal-button'); //$this->button->set('link', $link); $this->button->set('text', JText::_('COM_PHOCAGALLERY_DISPLAY_IMAGE_DETAIL')); //$this->button->set('name', 'image'); $this->button->set('modalname', 'modal_phocagalleryimgs'); $this->button->set('options', "{handler: 'image', size: {x: 200, y: 150}}"); $this->addToolbar(); parent::display($tpl); }
protected function getInput() { $helper = new BTBgSlideShowHelper(); if ($helper->checkPhocaComponent()) { $db = JFactory::getDBO(); //build the list of categories $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocagallery_categories AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering'; $db->setQuery($query); $phocagallerys = $db->loadObjectList(); // TODO - check for other views than category edit $view = JRequest::getVar('view'); $catId = -1; if ($view == 'phocagalleryc') { $id = $this->form->getValue('id'); // id of current category if ((int) $id > 0) { $catId = $id; } } $tree = array(); $text = ''; if (method_exists('PhocaGalleryRenderAdmin', 'CategoryTreeOption')) { $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($phocagallerys, $tree, 0, $text, $catId); } else { if (method_exists('PhocaGalleryCategory', 'CategoryTreeOption')) { $tree = PhocaGalleryCategory::CategoryTreeOption($phocagallerys, $tree, 0, $text, $catId); } else { $class = $this->element['class'] ? (string) $this->element['class'] : ''; return "<div class='{$class}'>" . JText::_('MOD_BTBGSLIDESHOW_PHOCA_ALERT') . "</div>"; } } array_unshift($tree, JHTML::_('select.option', '', '- ' . JText::_('MOD_BTBGSLIDESHOW_PHOCA_ALL_CATEGORIES') . ' -', 'value', 'text')); // Initialize JavaScript field attributes. $class = $this->element['class'] ? (string) $this->element['class'] : ''; $attr = ''; $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; $attr .= ' class="inputbox ' . $class . '"'; $document = JFactory::getDocument(); $document->addCustomTag('<script type="text/javascript"> function changeCatid() { var catid = document.getElementById(\'jform_catid\').value; var href = document.getElementById(\'pgselectytb\').href; href = href.substring(0, href.lastIndexOf("&")); href += \'&catid=\' + catid; document.getElementById(\'pgselectytb\').href = href; } </script>'); return JHTML::_('select.genericlist', $tree, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); } else { $class = $this->element['class'] ? (string) $this->element['class'] : ''; return "<div class='{$class}'>" . JText::_('MOD_BTBGSLIDESHOW_PHOCA_ALERT') . "</div>"; } }
function CategoryTreeOption($data, $tree, $id = 0, $text = '', $currentId) { foreach ($data as $key) { $show_text = $text . $key->text; if ($key->parentid == $id && $currentId != $id && $currentId != $key->value) { $tree[$key->value] = new JObject(); $tree[$key->value]->text = $show_text; $tree[$key->value]->value = $key->value; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($data, $tree, $key->value, $show_text . " - ", $currentId); } } return $tree; }
public static function options() { $db =& JFactory::getDBO(); //build the list of categories $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocagallery_categories AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering'; $db->setQuery($query); $phocagallerys = $db->loadObjectList(); $catId = -1; $javascript = 'class="inputbox" size="1" onchange="submitform( );"'; $tree = array(); $text = ''; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($phocagallerys, $tree, 0, $text, $catId); return $tree; }
public function display($tpl = null) { $params =& JComponentHelper::getParams('com_phocagallery'); JResponse::allowCache(false); JHTML::stylesheet('administrator/components/com_phocagallery/assets/phocagallery.css'); $document =& JFactory::getDocument(); $document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1)); $path = PhocaGalleryPath::getPath(); $this->field = JRequest::getVar('field'); $this->fce = 'phocaSelectFolder_' . $this->field; $this->assignRef('session', JFactory::getSession()); $this->assign('path_orig_rel', $path->image_rel); $this->assignRef('folders', $this->get('folders')); $this->assignRef('state', $this->get('state')); parent::display($tpl); }
public static function item($published, $category = 0) { // Create the copy/move options. $options = array(JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')), JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE'))); $db =& JFactory::getDBO(); //build the list of categories $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocagallery_categories AS a' . ' ORDER BY a.ordering'; $db->setQuery($query); $data = $db->loadObjectList(); $tree = array(); $text = ''; $catId = -1; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($data, $tree, 0, $text, $catId); if ($category == 1) { array_unshift($tree, JHTML::_('select.option', 0, JText::_('JLIB_HTML_ADD_TO_ROOT'), 'value', 'text')); } // Create the batch selector to change select the category by which to move or copy. $lines = array('<label id="batch-choose-action-lbl" for="batch-choose-action">', JText::_('JLIB_HTML_BATCH_MENU_LABEL'), '</label>', '<fieldset id="batch-choose-action" class="combo">', '<select name="batch[category_id]" class="inputbox" id="batch-category-id">', '<option value="">' . JText::_('JSELECT') . '</option>', JHTML::_('select.options', $tree), '</select>', JHTML::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'), '</fieldset>'); return implode("\n", $lines); }
function display($tpl = null) { $app = JFactory::getApplication(); //Frontend Changes $tUri = ''; if (!$app->isAdmin()) { $tUri = JURI::base(); phocagalleryimport('phocagallery.render.renderadmin'); } $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); JHTML::stylesheet('phocagallery.css', 'administrator/components/com_phocagallery/assets/'); $eName = JRequest::getVar('e_name'); $tmpl['ename'] = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName); $tmpl['backlink'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinks&tmpl=component&e_name=' . $tmpl['ename']; // Category Tree $db =& JFactory::getDBO(); $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocagallery_categories AS a' . ' ORDER BY a.ordering'; $db->setQuery($query); $categories = $db->loadObjectList(); $tree = array(); $text = ''; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($categories, $tree, 0, $text, -1); //----------------------------------------------------------------------- // Multiple $ctrl = 'hidecategories'; $attribs = ' '; $attribs .= ' size="5"'; //$attribs .= 'class="'.$v.'"'; $attribs .= ' class="inputbox"'; $attribs .= ' multiple="multiple"'; $ctrl .= ''; //$value = implode( '|', ) $categoriesOutput = JHTML::_('select.genericlist', $tree, $ctrl, $attribs, 'value', 'text', 0, 'hidecategories'); $this->assignRef('categoriesoutput', $categoriesOutput); $this->assignRef('tmpl', $tmpl); parent::display($tpl); }
public function display($tpl = null) { $params =& JComponentHelper::getParams('com_phocagallery'); $app = JFactory::getApplication(); JResponse::allowCache(false); JHTML::stylesheet('administrator/components/com_phocagallery/assets/phocagallery.css'); $document =& JFactory::getDocument(); $document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1)); $this->tmpl['catid'] = JRequest::getVar('catid', 0, '', 'int'); $this->tmpl['field'] = JRequest::getVar('field', '', '', 'string', JREQUEST_NOTRIM); $this->tmpl['import'] = JRequest::getVar('import', 0, '', 'int'); $this->tmpl['ytblink'] = ''; $this->tmpl['ytbtitle'] = ''; $this->tmpl['ytbdesc'] = ''; $this->tmpl['ytbfilename'] = ''; if ($this->tmpl['import'] == '1') { $this->tmpl['ytblink'] = $app->getUserStateFromRequest($this->context . '.ytb_link', 'ytb_link', $this->tmpl['ytblink'], 'string'); $this->tmpl['ytbtitle'] = $app->getUserStateFromRequest($this->context . '.ytb_title', 'ytb_titel', $this->tmpl['ytbtitle'], 'string'); $this->tmpl['ytbdesc'] = $app->getUserStateFromRequest($this->context . '.ytb_desc', 'ytb_desc', $this->tmpl['ytbdesc'], 'string'); $this->tmpl['ytbfilename'] = $app->getUserStateFromRequest($this->context . '.ytb_filename', 'ytb_filename', $this->tmpl['ytbfilename'], 'string'); } parent::display($tpl); }
public function display($tpl = null) { $this->field = JRequest::getVar('field'); $this->fce = 'phocaSelectFileName_' . $this->field; JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css'); $document =& JFactory::getDocument(); //$document->addCustomTag(PhocaGalleryRenderAdmin::renderIeCssLink(1)); $this->folderstate = $this->get('FolderState'); $this->images = $this->get('Images'); $this->folders = $this->get('Folders'); $this->session = JFactory::getSession(); $params = JComponentHelper::getParams('com_phocagallery'); $this->tmpl['enablethumbcreation'] = $params->get('enable_thumb_creation', 1); $this->tmpl['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int) $this->tmpl['enablethumbcreation']); $this->tmpl['multipleuploadchunk'] = $params->get('multiple_upload_chunk', 0); $this->tmpl['large_image_width'] = $params->get('large_image_width', 640); $this->tmpl['large_image_height'] = $params->get('large_image_height', 480); $this->tmpl['javaboxwidth'] = $params->get('java_box_width', 480); $this->tmpl['javaboxheight'] = $params->get('java_box_height', 480); $this->tmpl['uploadmaxsize'] = $params->get('upload_maxsize', 3145728); $this->tmpl['uploadmaxsizeread'] = PhocaGalleryFile::getFileSizeReadable($this->tmpl['uploadmaxsize']); $this->tmpl['uploadmaxreswidth'] = $params->get('upload_maxres_width', 3072); $this->tmpl['uploadmaxresheight'] = $params->get('upload_maxres_height', 2304); $this->tmpl['enablejava'] = $params->get('enable_java', -1); $this->tmpl['enablemultiple'] = $params->get('enable_multiple', 0); $this->tmpl['multipleuploadmethod'] = $params->get('multiple_upload_method', 1); $this->tmpl['multipleresizewidth'] = $params->get('multiple_resize_width', -1); $this->tmpl['multipleresizeheight'] = $params->get('multiple_resize_height', -1); $this->currentFolder = ''; if (isset($this->folderstate->folder) && $this->folderstate->folder != '') { $this->currentFolder = $this->folderstate->folder; } // - - - - - - - - - - //TABS // - - - - - - - - - - $this->tmpl['tab'] = JRequest::getVar('tab', '', '', 'string'); $this->tmpl['displaytabs'] = 0; // UPLOAD $this->tmpl['currenttab']['upload'] = $this->tmpl['displaytabs']; $this->tmpl['displaytabs']++; // MULTIPLE UPLOAD if ((int) $this->tmpl['enablemultiple'] >= 0) { $this->tmpl['currenttab']['multipleupload'] = $this->tmpl['displaytabs']; $this->tmpl['displaytabs']++; } // MULTIPLE UPLOAD if ($this->tmpl['enablejava'] >= 0) { $this->tmpl['currenttab']['javaupload'] = $this->tmpl['displaytabs']; $this->tmpl['displaytabs']++; } // - - - - - - - - - - - // Upload // - - - - - - - - - - - $sU = new PhocaGalleryFileUploadSingle(); $sU->returnUrl = 'index.php?option=com_phocagallery&view=phocagalleryi&tab=upload&tmpl=component&field=' . $this->field . '&folder=' . $this->currentFolder; $sU->tab = 'upload'; $this->tmpl['su_output'] = $sU->getSingleUploadHTML(); $this->tmpl['su_url'] = JURI::base() . 'index.php?option=com_phocagallery&task=phocagalleryu.upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=phocagalleryi&field=' . $this->field . '&' . 'folder=' . $this->currentFolder . '&tab=upload'; // - - - - - - - - - - - // Multiple Upload // - - - - - - - - - - - // Get infos from multiple upload $muFailed = JRequest::getVar('mufailed', '0', '', 'int'); $muUploaded = JRequest::getVar('muuploaded', '0', '', 'int'); $this->tmpl['mu_response_msg'] = $muUploadedMsg = ''; if ($muUploaded > 0) { $muUploadedMsg = JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded; } if ($muFailed > 0) { $muFailedMsg = JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed; } if ($muFailed > 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="alert alert-info">' . '<button type="button" class="close" data-dismiss="alert">×</button>' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '<br />' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed > 0 && $muUploaded == 0) { $this->tmpl['mu_response_msg'] = '<div class="alert alert-error">' . '<button type="button" class="close" data-dismiss="alert">×</button>' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed == 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="alert alert-success">' . '<button type="button" class="close" data-dismiss="alert">×</button>' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '</div>'; } else { $this->tmpl['mu_response_msg'] = ''; } } } if ((int) $this->tmpl['enablemultiple'] >= 0) { PhocaGalleryFileUploadMultiple::renderMultipleUploadLibraries(); $mU = new PhocaGalleryFileUploadMultiple(); $mU->frontEnd = 0; $mU->method = $this->tmpl['multipleuploadmethod']; $mU->url = JURI::base() . 'index.php?option=com_phocagallery&task=phocagalleryu.multipleupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=multipleupload&field=' . $this->field . '&folder=' . $this->currentFolder; $mU->reload = JURI::base() . 'index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&tab=multipleupload&' . 'field=' . $this->field . '&folder=' . $this->currentFolder; $mU->maxFileSize = PhocaGalleryFileUploadMultiple::getMultipleUploadSizeFormat($this->tmpl['uploadmaxsize']); $mU->chunkSize = '1mb'; $mU->imageHeight = $this->tmpl['multipleresizeheight']; $mU->imageWidth = $this->tmpl['multipleresizewidth']; $mU->imageQuality = 100; $mU->renderMultipleUploadJS(0, $this->tmpl['multipleuploadchunk']); $this->tmpl['mu_output'] = $mU->getMultipleUploadHTML(); } // - - - - - - - - - - - // Java Upload // - - - - - - - - - - - if ((int) $this->tmpl['enablejava'] >= 0) { $jU = new PhocaGalleryFileUploadJava(); $jU->width = $this->tmpl['javaboxwidth']; $jU->height = $this->tmpl['javaboxheight']; $jU->resizewidth = $this->tmpl['multipleresizewidth']; $jU->resizeheight = $this->tmpl['multipleresizeheight']; $jU->uploadmaxsize = $this->tmpl['uploadmaxsize']; $jU->returnUrl = JURI::base() . 'index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&tab=javaupload&' . 'field=' . $this->field . '&folder=' . $this->currentFolder; $jU->url = JURI::base() . 'index.php?option=com_phocagallery&task=phocagalleryu.javaupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JSession::getFormToken() . '=1&viewback=phocagalleryi&tab=javaupload' . '&field=' . $this->field . '&folder=' . $this->currentFolder; $jU->source = JURI::root(true) . '/components/com_phocagallery/assets/jupload/wjhk.jupload.jar'; $this->tmpl['ju_output'] = $jU->getJavaUploadHTML(); } $this->tmpl['ftp'] = !JClientHelper::hasCredentials('ftp'); parent::display($tpl); echo JHTML::_('behavior.keepalive'); }
function display($tpl = null) { $app = JFactory::getApplication(); $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); $menus =& JSite::getMenu(); $menu = $menus->getActive(); $this->params =& $app->getParams(); $user =& JFactory::getUser(); $path = PhocaGalleryPath::getPath(); $neededAccessLevels = PhocaGalleryAccess::getNeededAccessLevels(); $access = PhocaGalleryAccess::isAccess($user->authorisedLevels(), $neededAccessLevels); $this->tmpl['fi'] = PhocaGalleryImage::getFormatIcon(); $this->tmpl['pi'] = 'components/com_phocagallery/assets/images/'; $this->tmpl['pp'] = 'index.php?option=com_phocagallery&view=user&controller=user'; $this->tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($this->tmpl['pp'] . '&Itemid=' . JRequest::getVar('Itemid', 0, '', 'int')); // LIBRARY $library =& PhocaGalleryLibrary::getLibrary(); $libraries['pg-css-ie'] = $library->getLibrary('pg-css-ie'); // Only registered users if (!$access) { $app->redirect(JRoute::_($this->tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION')); exit; } $this->tmpl['gallerymetakey'] = $this->params->get('gallery_metakey', ''); $this->tmpl['gallerymetadesc'] = $this->params->get('gallery_metadesc', ''); if ($this->tmpl['gallerymetakey'] != '') { $document->setMetaData('keywords', $this->tmpl['gallerymetakey']); } if ($this->tmpl['gallerymetadesc'] != '') { $document->setMetaData('description', $this->tmpl['gallerymetadesc']); } $this->tmpl['enablecustomcss'] = $this->params->get('enable_custom_css', 0); $this->tmpl['customcss'] = $this->params->get('custom_css', ''); // CSS JHtml::stylesheet('components/com_phocagallery/assets/phocagallery.css'); if ($this->tmpl['enablecustomcss'] == 1) { JHtml::stylesheet('components/com_phocagallery/assets/phocagallerycustom.css'); PhocaGalleryRenderFront::displayCustomCSS($this->tmpl['customcss']); } else { if ($libraries['pg-css-ie']->value == 0) { $document->addCustomTag("<!--[if lt IE 8]>\n<link rel=\"stylesheet\" href=\"" . JURI::base(true) . "/components/com_phocagallery/assets/phocagalleryieall.css\" type=\"text/css\" />\n<![endif]-->"); $library->setLibrary('pg-css-ie', 1); } } // = = = = = = = = = = = // PANE // = = = = = = = = = = = // - - - - - - - - - - // ALL TABS // - - - - - - - - - - // UCP is disabled (security reasons) if ((int) $this->params->get('enable_user_cp', 0) == 0) { $app->redirect(JURI::base(true), JText::_('COM_PHOCAGALLERY_UCP_DISABLED')); exit; } $this->tmpl['tab'] = JRequest::getVar('tab', 0, '', 'string'); $this->tmpl['maxuploadchar'] = $this->params->get('max_upload_char', 1000); $this->tmpl['maxcreatecatchar'] = $this->params->get('max_create_cat_char', 1000); $this->tmpl['dp'] = PhocaGalleryRenderInfo::getPhocaIc((int) $this->params->get('display_phoca_info', 1)); $this->tmpl['showpageheading'] = $this->params->get('show_page_heading', 1); $this->tmpl['javaboxwidth'] = $this->params->get('java_box_width', 480); $this->tmpl['javaboxheight'] = $this->params->get('java_box_height', 480); $this->tmpl['enableuploadavatar'] = $this->params->get('enable_upload_avatar', 1); $this->tmpl['uploadmaxsize'] = $this->params->get('upload_maxsize', 3145728); $this->tmpl['uploadmaxsizeread'] = PhocaGalleryFile::getFileSizeReadable($this->tmpl['uploadmaxsize']); $this->tmpl['uploadmaxreswidth'] = $this->params->get('upload_maxres_width', 3072); $this->tmpl['uploadmaxresheight'] = $this->params->get('upload_maxres_height', 2304); $this->tmpl['multipleuploadchunk'] = $this->params->get('multiple_upload_chunk', 0); $this->tmpl['displaytitleupload'] = $this->params->get('display_title_upload', 0); $this->tmpl['displaydescupload'] = $this->params->get('display_description_upload', 0); $this->tmpl['enablejava'] = $this->params->get('enable_java', 0); $this->tmpl['enablemultiple'] = $this->params->get('enable_multiple', 0); $this->tmpl['ytbupload'] = $this->params->get('youtube_upload', 0); $this->tmpl['multipleuploadmethod'] = $this->params->get('multiple_upload_method', 1); $this->tmpl['multipleresizewidth'] = $this->params->get('multiple_resize_width', -1); $this->tmpl['multipleresizeheight'] = $this->params->get('multiple_resize_height', -1); $this->tmpl['usersubcatcount'] = $this->params->get('user_subcat_count', 5); $this->tmpl['userimagesmaxspace'] = $this->params->get('user_images_max_size', 20971520); $this->tmpl['iepx'] = '<div style="font-size:1px;height:1px;margin:0px;padding:0px;"> </div>'; //Subcateogry $this->tmpl['parentid'] = JRequest::getVar('parentcategoryid', 0, 'post', 'int'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/comments.js'); $document->addCustomTag(PhocaGalleryRenderFront::renderOnUploadJS()); $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionCreateCatJS((int) $this->tmpl['maxcreatecatchar'])); $document->addCustomTag(PhocaGalleryRenderFront::userTabOrdering()); // SubCategory + Image $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionCreateSubCatJS((int) $this->tmpl['maxcreatecatchar'])); $document->addCustomTag(PhocaGalleryRenderFront::saveOrderUserJS()); $model = $this->getModel('user'); $ownerMainCategory = $model->getOwnerMainCategory($user->id); $this->tmpl['usertab'] = 1; $this->tmpl['createcategory'] = 1; $this->tmpl['createsubcategory'] = 1; $this->tmpl['images'] = 1; $this->tmpl['displayupload'] = 1; // Tabs $displayTabs = 0; if ((int) $this->tmpl['usertab'] == 0) { $currentTab['user'] = -1; } else { $currentTab['user'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['createcategory'] == 0) { $currentTab['createcategory'] = -1; } else { $currentTab['createcategory'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['createsubcategory'] == 0) { $currentTab['createsubcategory'] = -1; } else { $currentTab['createsubcategory'] = $displayTabs; $displayTabs++; } if ((int) $this->tmpl['displayupload'] == 0) { $currentTab['images'] = -1; } else { $currentTab['images'] = $displayTabs; $displayTabs++; } $this->tmpl['displaytabs'] = $displayTabs; $this->tmpl['currenttab'] = $currentTab; // ACTION $this->tmpl['action'] = $uri->toString(); $this->tmpl['ftp'] = !JClientHelper::hasCredentials('ftp'); $this->assignRef('session', JFactory::getSession()); // SEF problem $isThereQM = false; $isThereQM = preg_match("/\\?/i", $this->tmpl['action']); if ($isThereQM) { $amp = '&'; } else { $amp = '?'; } $this->tmpl['actionamp'] = $this->tmpl['action'] . $amp; $this->tmpl['istheretab'] = false; $this->tmpl['istheretab'] = preg_match("/tab=/i", $this->tmpl['action']); // EDIT - subcategory, image $this->tmpl['task'] = JRequest::getVar('task', '', 'get', 'string', 0); $id = JRequest::getVar('id', '', 'get', 'string', 0); $idAlias = $id; // - - - - - - - - - - - // USER (AVATAR) // - - - - - - - - - - - $this->tmpl['user'] = $user->name; $this->tmpl['username'] = $user->username; $this->tmpl['useravatarimg'] = JHtml::_('image', $this->tmpl['pi'] . 'phoca_thumb_m_no_image.' . $this->tmpl['fi'], ''); $this->tmpl['useravatarapproved'] = 0; $userAvatar = $model->getUserAvatar($user->id); if ($userAvatar) { $pathAvatarAbs = $path->avatar_abs . 'thumbs' . DS . 'phoca_thumb_m_' . $userAvatar->avatar; $pathAvatarRel = $path->avatar_rel . 'thumbs/phoca_thumb_m_' . $userAvatar->avatar; if (JFile::exists($pathAvatarAbs)) { $this->tmpl['useravatarimg'] = '<img src="' . JURI::base(true) . '/' . $pathAvatarRel . '?imagesid=' . md5(uniqid(time())) . '" alt="" />'; $this->tmpl['useravatarapproved'] = $userAvatar->approved; } } if ($ownerMainCategory) { $this->tmpl['usermaincategory'] = $ownerMainCategory->title; } else { $this->tmpl['usermaincategory'] = JHtml::_('image', $this->tmpl['pi'] . 'icon-unpublish.' . $this->tmpl['fi'], JText::_('COM_PHOCAGALLERY_NOT_CREATED')) . ' (' . JText::_('COM_PHOCAGALLERY_NOT_CREATED') . ')'; } $this->tmpl['usersubcategory'] = $model->getCountUserSubCat($user->id); $this->tmpl['usersubcategoryleft'] = (int) $this->tmpl['usersubcatcount'] - (int) $this->tmpl['usersubcategory']; if ((int) $this->tmpl['usersubcategoryleft'] < 0) { $this->tmpl['usersubcategoryleft'] = 0; } $this->tmpl['userimages'] = $model->getCountUserImage($user->id); $this->tmpl['userimagesspace'] = $model->getSumUserImage($user->id); $this->tmpl['userimagesspaceleft'] = (int) $this->tmpl['userimagesmaxspace'] - (int) $this->tmpl['userimagesspace']; if ((int) $this->tmpl['userimagesspaceleft'] < 0) { $this->tmpl['userimagesspaceleft'] = 0; } $this->tmpl['userimagesspace'] = PhocaGalleryFile::getFileSizeReadable($this->tmpl['userimagesspace']); $this->tmpl['userimagesspaceleft'] = PhocaGalleryFile::getFileSizeReadable($this->tmpl['userimagesspaceleft']); $this->tmpl['userimagesmaxspace'] = PhocaGalleryFile::getFileSizeReadable($this->tmpl['userimagesmaxspace']); // - - - - - - - - - - - // MAIN CATEGORY // - - - - - - - - - - - $ownerMainCategory = $model->getOwnerMainCategory($user->id); if (!empty($ownerMainCategory->id)) { if ((int) $ownerMainCategory->published == 1) { $this->tmpl['categorycreateoredithead'] = JText::_('COM_PHOCAGALLERY_MAIN_CATEGORY'); $this->tmpl['categorycreateoredit'] = JText::_('COM_PHOCAGALLERY_EDIT'); $this->tmpl['categorytitle'] = $ownerMainCategory->title; $this->tmpl['categoryapproved'] = $ownerMainCategory->approved; $this->tmpl['categorydescription'] = $ownerMainCategory->description; $this->tmpl['categorypublished'] = 1; } else { $this->tmpl['categorypublished'] = 0; } } else { $this->tmpl['categorycreateoredithead'] = JText::_('COM_PHOCAGALLERY_MAIN_CATEGORY'); $this->tmpl['categorycreateoredit'] = JText::_('COM_PHOCAGALLERY_CREATE'); $this->tmpl['categorytitle'] = ''; $this->tmpl['categorydescription'] = ''; $this->tmpl['categoryapproved'] = ''; $this->tmpl['categorypublished'] = -1; } // - - - - - - - - - - - // SUBCATEGORY // - - - - - - - - - - - if (!empty($ownerMainCategory->id)) { // EDIT $this->tmpl['categorysubcatedit'] = $model->getCategory((int) $id, $user->id); $this->tmpl['displaysubcategory'] = 1; // Get All Data - Subcategories $this->tmpl['subcategoryitems'] = $model->getDataSubcat($user->id); $this->tmpl['subcategorytotal'] = count($this->tmpl['subcategoryitems']); $model->setTotalSubCat($this->tmpl['subcategorytotal']); $this->tmpl['subcategorypagination'] = $model->getPaginationSubCat($user->id); $this->tmpl['subcategoryitems'] = array_slice($this->tmpl['subcategoryitems'], (int) $this->tmpl['subcategorypagination']->limitstart, (int) $this->tmpl['subcategorypagination']->limit); $filter_state_subcat = $app->getUserStateFromRequest($this->_context_subcat . '.filter_state', 'filter_state_subcat', '', 'word'); $filter_catid_subcat = $app->getUserStateFromRequest($this->_context_subcat . '.filter_catid', 'filter_catid_subcat', 0, 'int'); $filter_order_subcat = $app->getUserStateFromRequest($this->_context_subcat . '.filter_order', 'filter_order_subcat', 'a.ordering', 'cmd'); $filter_order_Dir_subcat = $app->getUserStateFromRequest($this->_context_subcat . '.filter_order_Dir', 'filter_order_Dir_subcat', '', 'word'); $search_subcat = $app->getUserStateFromRequest($this->_context_subcat . '.search', 'phocagallerysubcatsearch', '', 'string'); if (strpos($search_subcat, '"') !== false) { $search_subcat = str_replace(array('=', '<'), '', $search_subcat); } $search_subcat = JString::strtolower($search_subcat); $categories = $model->getCategoryList($user->id); if (!empty($categories)) { $javascript = 'class="inputbox" size="1" onchange="document.phocagallerysubcatform.submit();"'; $tree = array(); $text = ''; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($categories, $tree, 0, $text, -1); array_unshift($tree, JHtml::_('select.option', '0', '- ' . JText::_('COM_PHOCAGALLERY_SELECT_CATEGORY') . ' -', 'value', 'text')); $lists_subcat['catid'] = JHtml::_('select.genericlist', $tree, 'filter_catid_subcat', $javascript, 'value', 'text', $filter_catid_subcat); } $this->tmpl['parentcategoryid'] = $filter_catid_subcat; // state filter //$lists['state'] = JHtml::_('grid.state', $filter_state ); $state_subcat[] = JHtml::_('select.option', '', '- ' . JText::_('COM_PHOCAGALLERY_SELECT_STATE') . ' -'); $state_subcat[] = JHtml::_('select.option', 'P', JText::_('COM_PHOCAGALLERY_PUBLISHED')); $state_subcat[] = JHtml::_('select.option', 'U', JText::_('COM_PHOCAGALLERY_UNPUBLISHED')); $lists_subcat['state'] = JHtml::_('select.genericlist', $state_subcat, 'filter_state_subcat', 'class="inputbox" size="1" onchange="document.phocagallerysubcatform.submit();"', 'value', 'text', $filter_state_subcat); // table ordering $lists_subcat['order_Dir'] = $filter_order_Dir_subcat; $lists_subcat['order'] = $filter_order_subcat; $this->tmpl['subcategoryordering'] = $lists_subcat['order'] == 'a.ordering'; //Ordering allowed ? // search filter $lists_subcat['search'] = $search_subcat; } else { $this->tmpl['displaysubcategory'] = 0; } // - - - - - - - - - - - // IMAGES // - - - - - - - - - - - if (!empty($ownerMainCategory->id)) { $catAccess = PhocaGalleryAccess::getCategoryAccess((int) $ownerMainCategory->id); // EDIT $this->tmpl['imageedit'] = $model->getImage((int) $id, $user->id); $this->tmpl['imageitems'] = $model->getDataImage($user->id); $this->tmpl['imagetotal'] = $model->getTotalImage($user->id); $this->tmpl['imagepagination'] = $model->getPaginationImage($user->id); $filter_state_image = $app->getUserStateFromRequest($this->_context_image . '.filter_state', 'filter_state_image', '', 'word'); $filter_catid_image = $app->getUserStateFromRequest($this->_context_image . '.filter_catid', 'filter_catid_image', 0, 'int'); $filter_order_image = $app->getUserStateFromRequest($this->_context_image . '.filter_order', 'filter_order_image', 'a.ordering', 'cmd'); $filter_order_Dir_image = $app->getUserStateFromRequest($this->_context_image . '.filter_order_Dir', 'filter_order_Dir_image', '', 'word'); $search_image = $app->getUserStateFromRequest($this->_context_image . '.search', 'phocagalleryimagesearch', '', 'string'); if (strpos($search_image, '"') !== false) { $search_image = str_replace(array('=', '<'), '', $search_image); } $search_image = JString::strtolower($search_image); $categoriesImage = $model->getCategoryList($user->id); if (!empty($categoriesImage)) { $javascript = 'class="inputbox" size="1" onchange="document.phocagalleryimageform.submit();"'; $tree = array(); $text = ''; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($categoriesImage, $tree, 0, $text, -1); array_unshift($tree, JHtml::_('select.option', '0', '- ' . JText::_('COM_PHOCAGALLERY_SELECT_CATEGORY') . ' -', 'value', 'text')); $lists_image['catid'] = JHtml::_('select.genericlist', $tree, 'filter_catid_image', $javascript, 'value', 'text', $filter_catid_image); } // state filter $state_image[] = JHtml::_('select.option', '', '- ' . JText::_('COM_PHOCAGALLERY_SELECT_STATE') . ' -'); $state_image[] = JHtml::_('select.option', 'P', JText::_('COM_PHOCAGALLERY_FIELD_PUBLISHED_LABEL')); $state_image[] = JHtml::_('select.option', 'U', JText::_('COM_PHOCAGALLERY_FIELD_UNPUBLISHED_LABEL')); $lists_image['state'] = JHtml::_('select.genericlist', $state_image, 'filter_state_image', 'class="inputbox" size="1" onchange="document.phocagalleryimageform.submit();"', 'value', 'text', $filter_state_image); // table ordering $lists_image['order_Dir'] = $filter_order_Dir_image; $lists_image['order'] = $filter_order_image; $this->tmpl['imageordering'] = $lists_image['order'] == 'a.ordering'; //Ordering allowed ? // search filter $lists_image['search'] = $search_image; $this->tmpl['catidimage'] = $filter_catid_image; // Upload $this->tmpl['displayupload'] = 0; // USER RIGHT - UPLOAD - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $rightDisplayUpload = 0; // default is to null (all users cannot upload) if (!empty($catAccess)) { $rightDisplayUpload = PhocaGalleryAccess::getUserRight('uploaduserid', $catAccess->uploaduserid, 2, $user->authorisedLevels(), $user->get('id', 0), 0); } if ($rightDisplayUpload == 1) { $this->tmpl['displayupload'] = 1; $document->addCustomTag(PhocaGalleryRenderFront::renderDescriptionUploadJS((int) $this->tmpl['maxuploadchar'])); } // - - - - - - - - - - - - - - - - - - - - - // USER RIGHT - ACCESS - - - - - - - - - - - $rightDisplay = 1; //default is set to 1 (all users can see the category) if (!empty($catAccess)) { $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $catAccess->accessuserid, 0, $user->authorisedLevels(), $user->get('id', 0), 1); } if ($rightDisplay == 0) { $app->redirect(JRoute::_($this->tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION')); exit; } // - - - - - - - - - - - - - - - - - - - - - // = = = = = = = = = = // U P L O A D // = = = = = = = = = = // - - - - - - - - - - - // Upload // - - - - - - - - - - - if ((int) $this->tmpl['displayupload'] == 1) { $sU = new PhocaGalleryFileUploadSingle(); $sU->returnUrl = $this->tmpl['action'] . $amp . 'task=upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['images']; $sU->tab = $this->tmpl['currenttab']['images']; $this->tmpl['su_output'] = $sU->getSingleUploadHTML(1); $this->tmpl['su_url'] = $this->tmpl['action'] . $amp . 'task=upload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['images']; } // - - - - - - - - - - - // Youtube Upload (single upload form can be used) // - - - - - - - - - - - if ((int) $this->tmpl['ytbupload'] > 0) { $sYU = new PhocaGalleryFileUploadSingle(); $sYU->returnUrl = $this->tmpl['action'] . $amp . 'task=ytbupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['images']; $sYU->tab = $this->tmpl['currenttab']['images']; $this->tmpl['syu_output'] = $sYU->getSingleUploadHTML(1); $this->tmpl['syu_url'] = $this->tmpl['action'] . $amp . 'task=ytbupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&viewback=category&tab=' . $this->tmpl['currenttab']['images']; } // - - - - - - - - - - - // Multiple Upload // - - - - - - - - - - - // Get infos from multiple upload $muFailed = JRequest::getVar('mufailed', '0', '', 'int'); $muUploaded = JRequest::getVar('muuploaded', '0', '', 'int'); $this->tmpl['mu_response_msg'] = $muUploadedMsg = ''; if ($muUploaded > 0) { $muUploadedMsg = JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded; } if ($muFailed > 0) { $muFailedMsg = JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed; } if ($muFailed > 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="pgunsetmsg">' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '<br />' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed > 0 && $muUploaded == 0) { $this->tmpl['mu_response_msg'] = '<div class="pgerrormsg">' . JText::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG') . ': ' . $muFailed . '</div>'; } else { if ($muFailed == 0 && $muUploaded > 0) { $this->tmpl['mu_response_msg'] = '<div class="pgsuccessmsg">' . JText::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG') . ': ' . $muUploaded . '</div>'; } else { $this->tmpl['mu_response_msg'] = ''; } } } if ((int) $this->tmpl['enablemultiple'] == 1 && (int) $this->tmpl['displayupload'] == 1) { PhocaGalleryFileUploadMultiple::renderMultipleUploadLibraries(); $mU = new PhocaGalleryFileUploadMultiple(); $mU->frontEnd = 2; $mU->method = $this->tmpl['multipleuploadmethod']; $mU->url = $this->tmpl['action'] . $amp . 'controller=user&task=multipleupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['images'] . '&catid=' . $this->tmpl['catidimage']; $mU->reload = $this->tmpl['action'] . $amp . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['images']; $mU->maxFileSize = PhocaGalleryFileUploadMultiple::getMultipleUploadSizeFormat($this->tmpl['uploadmaxsize']); $mU->chunkSize = '1mb'; $mU->imageHeight = $this->tmpl['multipleresizeheight']; $mU->imageWidth = $this->tmpl['multipleresizewidth']; $mU->imageQuality = 100; $mU->renderMultipleUploadJS(0, $this->tmpl['multipleuploadchunk']); $this->tmpl['mu_output'] = $mU->getMultipleUploadHTML(); } // - - - - - - - - - - - // Java Upload // - - - - - - - - - - - if ((int) $this->tmpl['enablejava'] == 1 && (int) $this->tmpl['displayupload'] == 1) { $jU = new PhocaGalleryFileUploadJava(); $jU->width = $this->tmpl['javaboxwidth']; $jU->height = $this->tmpl['javaboxheight']; $jU->resizewidth = $this->tmpl['multipleresizewidth']; $jU->resizeheight = $this->tmpl['multipleresizeheight']; $jU->uploadmaxsize = $this->tmpl['uploadmaxsize']; $jU->returnUrl = $this->tmpl['action'] . $amp . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['images']; $jU->url = $this->tmpl['action'] . $amp . 'controller=user&task=javaupload&' . $this->session->getName() . '=' . $this->session->getId() . '&' . JUtility::getToken() . '=1&tab=' . $this->tmpl['currenttab']['images'] . '&catid=' . $this->tmpl['catidimage']; $jU->source = JURI::root(true) . '/components/com_phocagallery/assets/java/jupload/wjhk.jupload.jar'; $this->tmpl['ju_output'] = $jU->getJavaUploadHTML(); } } else { $this->tmpl['displayupload'] = 0; } if (!empty($ownerMainCategory->id)) { $this->tmpl['ps'] = '&tab=' . $this->tmpl['currenttab']['createsubcategory'] . '&limitstartsubcat=' . $this->tmpl['subcategorypagination']->limitstart . '&limitstartimage=' . $this->tmpl['imagepagination']->limitstart; } else { $this->tmpl['ps'] = '&tab=' . $this->tmpl['currenttab']['createsubcategory']; } if (!empty($ownerMainCategory->id)) { $this->tmpl['psi'] = '&tab=' . $this->tmpl['currenttab']['images'] . '&limitstartsubcat=' . $this->tmpl['subcategorypagination']->limitstart . '&limitstartimage=' . $this->tmpl['imagepagination']->limitstart; } else { $this->tmpl['psi'] = '&tab=' . $this->tmpl['currenttab']['images']; } // ASIGN $this->assignRef('listssubcat', $lists_subcat); $this->assignRef('listsimage', $lists_image); //$this->assignRef( 'tmpl', $this->tmpl); //$this->assignRef( 'params', $this->params); $this->assignRef('session', JFactory::getSession()); $this->_prepareDocument(); parent::display($tpl); }
$link = 'index.php?option=com_phocagallery&view=phocagallerycos'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-comment.png', JText::_('COM_PHOCAGALLERY_CATEGORY_COMMENTS')); $link = 'index.php?option=com_phocagallery&view=phocagallerycoimgs'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-comment-img.png', JText::_('COM_PHOCAGALLERY_IMAGE_COMMENTS')); $link = 'index.php?option=com_phocagallery&view=phocagalleryusers'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-users.png', JText::_('COM_PHOCAGALLERY_USERS')); $link = 'index.php?option=com_phocagallery&view=phocagalleryfbs'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-fb.png', JText::_('COM_PHOCAGALLERY_FB')); $link = 'index.php?option=com_phocagallery&view=phocagallerytags'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-tags.png', JText::_('COM_PHOCAGALLERY_TAGS')); $link = 'index.php?option=com_phocagallery&view=phocagalleryimgs&task=phocagallerym.edit'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-multiple.png', JText::_('COM_PHOCAGALLERY_MULTIPLE_ADD')); //$link = 'index.php?option=com_phocagallery&view=phocagalleryucs'; //echo PhocaGalleryRenderAdmin::quickIconButton( $link, 'icon-48-pg-users-cat.png', JText::_( 'Users Categories' ) ); $link = 'index.php?option=com_phocagallery&view=phocagalleryin'; echo PhocaGalleryRenderAdmin::quickIconButton($link, 'icon-48-pg-info.png', JText::_('COM_PHOCAGALLERY_INFO')); ?> <div style="clear:both"> </div> <p> </p> <div style="text-align:center;padding:0;margin:0;border:0"> <iframe style="padding:0;margin:0;border:0" src="http://www.phoca.cz/adv/phocagallery" noresize="noresize" frameborder="0" border="0" cellspacing="0" scrolling="no" width="500" marginwidth="0" marginheight="0" height="125"> <a href="http://www.phoca.cz/adv/phocagallery" target="_blank">Phoca Gallery</a> </iframe> </div> </div> </div> <div class="cpanel-right"> <div style="border:1px solid #ccc;background:#fff;margin:15px;padding:15px"> <div style="float:right;margin:10px;">
public function display($tpl = null) { $tmpl = array(); $params = JComponentHelper::getParams('com_phocagallery'); $this->sidebar = JHtmlSidebar::render(); JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css'); $tmpl['version'] = PhocaGalleryRenderInfo::getPhocaVersion(); $tmpl['enablethumbcreation'] = $params->get('enable_thumb_creation', 1); $tmpl['paginationthumbnailcreation'] = $params->get('pagination_thumbnail_creation', 0); $tmpl['cleanthumbnails'] = $params->get('clean_thumbnails', 0); $tmpl['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int) $tmpl['enablethumbcreation'], 1); //Main Function support // echo '<table border="1" cellpadding="5" cellspacing="5" style="border:1px solid #ccc;border-collapse:collapse">'; $function = array('getImageSize', 'imageCreateFromJPEG', 'imageCreateFromPNG', 'imageCreateFromGIF', 'imageRotate', 'imageCreateTruecolor', 'imageCopyResampled', 'imageFill', 'imageColorTransparent', 'imageColorAllocate', 'exif_read_data'); $fOutput = ''; foreach ($function as $key => $value) { if (function_exists($value)) { $bgStyle = 'class="alert alert-success"'; $icon = 'true'; $iconText = JText::_('COM_PHOCAGALLERY_ENABLED'); } else { $bgStyle = 'class="alert alert-error"'; $icon = 'false'; $iconText = JText::_('COM_PHOCAGALLERY_DISABLED'); } $fOutput .= '<tr ' . $bgStyle . '><td>' . JText::_('COM_PHOCAGALLERY_FUNCTION') . ' ' . $value . '</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED')) . '</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-' . $icon . '.png', JText::_($iconText)) . '</td></tr>'; } // PICASA $fOutput .= '<tr><td align="left"><b>' . JText::_('COM_PHOCAGALLERY_PICASA_SUPPORT') . '</b></td></tr>'; if (!PhocaGalleryUtils::iniGetBool('allow_url_fopen')) { $bgStyle = 'class="alert alert-error"'; $icon = 'false'; $iconText = JText::_('COM_PHOCAGALLERY_DISABLED'); } else { $bgStyle = 'class="alert alert-success"'; $icon = 'true'; $iconText = JText::_('COM_PHOCAGALLERY_ENABLED'); } $fOutput .= '<tr ' . $bgStyle . '><td>' . JText::_('COM_PHOCAGALLERY_PHP_SETTINGS_PARAM') . ' allow_url_fopen (' . JText::_('COM_PHOCAGALLERY_ENABLED_IF_CURL_DISABLED') . ')</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED')) . '</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-' . $icon . '.png', JText::_($iconText)) . '</td></tr>'; if (function_exists("curl_init")) { $bgStyle = 'class="alert alert-success"'; $icon = 'true'; $iconText = JText::_('COM_PHOCAGALLERY_ENABLED'); } else { $bgStyle = 'class="alert alert-error"'; $icon = 'false'; $iconText = JText::_('COM_PHOCAGALLERY_DISABLED'); } if (function_exists("json_decode")) { $bgStylej = 'class="alert alert-success"'; $iconj = 'true'; $iconTextj = JText::_('COM_PHOCAGALLERY_ENABLED'); } else { $bgStylej = 'class="alert alert-error"'; $iconj = 'false'; $iconTextj = JText::_('COM_PHOCAGALLERY_DISABLED'); } $fOutput .= '<tr ' . $bgStyle . '><td>' . JText::_('COM_PHOCAGALLERY_FUNCTION') . ' cURL (' . JText::_('COM_PHOCAGALLERY_ENABLED_IF_FOPEN_DISABLED') . ')</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED')) . '</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-' . $icon . '.png', JText::_($iconText)) . '</td></tr>'; $fOutput .= '<tr ' . $bgStylej . '><td>' . JText::_('COM_PHOCAGALLERY_FUNCTION') . ' json_decode</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED')) . '</td>'; $fOutput .= '<td align="center">' . JHTML::_('image', 'media/com_phocagallery/images/administrator/icon-16-' . $iconj . '.png', JText::_($iconTextj)) . '</td></tr>'; $this->assignRef('tmpl', $tmpl); $this->assignRef('foutput', $fOutput); $this->addToolbar(); parent::display($tpl); }
function onPrepareContent(&$article, &$params, $limitstart) { $user =& JFactory::getUser(); $gid = $user->get('aid', 0); $db =& JFactory::getDBO(); $menu =& JSite::getMenu(); $document =& JFactory::getDocument(); // PARAMS - direct from Phoca Gallery Global configuration $component = 'com_phocagallery'; $table =& JTable::getInstance('component'); $table->loadByOption($component); $paramsC = new JParameter($table->params); // LIBRARY $library =& PhocaGalleryLibrary::getLibrary(); $libraries['pg-css-sbox-plugin'] = $library->getLibrary('pg-css-sbox-plugin'); $libraries['pg-css-pg-plugin'] = $library->getLibrary('pg-css-pg-plugin'); $libraries['pg-css-ie'] = $library->getLibrary('pg-css-ie'); $libraries['pg-group-shadowbox'] = $library->getLibrary('pg-group-shadowbox'); $libraries['pg-group-highslide'] = $library->getLibrary('pg-group-highslide'); $libraries['pg-overlib-group'] = $library->getLibrary('pg-overlib-group'); // PicLens CSS and JS will be loaded only one time in the site (pg-pl-piclens) // BUT PicLens Category will be loaded everytime new category should be displayed on the site $libraries['pg-pl-piclens'] = $library->getLibrary('pg-pl-piclens'); // Start Plugin $regex_one = '/({phocagallery\\s*)(.*?)(})/si'; $regex_all = '/{phocagallery\\s*.*?}/si'; $matches = array(); $count_matches = preg_match_all($regex_all, $article->text, $matches, PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER); $cssPgPlugin = ''; $cssSbox = ''; // Start if count_matches if ($count_matches != 0) { // Start CSS $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/phocagallery.css'); for ($i = 0; $i < $count_matches; $i++) { $this->_setPluginNumber(); // Plugin variables $view = ''; $catid = 0; $imageid = 0; $imagerandom = 0; $image_background_shadow = $paramsC->get('image_background_shadow', 'none'); $limitstart = 0; $limitcount = 0; $switch_width = $paramsC->get('switch_width', 640); $switch_height = $paramsC->get('switch_height', 480); $basic_image_id = $paramsC->get('switch_image', 0); $enable_switch = 0; $display_name = $paramsC->get('display_name', 1); $display_icon_detail = $paramsC->get('display_icon_detail', 1); $display_icon_download = $paramsC->get('display_icon_download', 1); $detail_window = $paramsC->get('detail_window', 0); $detail_buttons = $paramsC->get('detail_buttons', 1); $hide_categories = $paramsC->get('hide_categories', ''); $namefontsize = $paramsC->get('font_size_name', 12); $namenumchar = $paramsC->get('char_length_name', 11); $display_description = $paramsC->get('display_description_detail', 0); $description_height = $paramsC->get('description_detail_height', 16); $category_box_space = $paramsC->get('category_box_space', 0); // CSS $font_color = $paramsC->get('font_color', '#b36b00'); $background_color = $paramsC->get('background_color', '#fcfcfc'); $background_color_hover = $paramsC->get('background_color_hover', '#f5f5f5'); $image_background_color = $paramsC->get('image_background_color', '#f5f5f5'); $border_color = $paramsC->get('border_color', '#e8e8e8'); $border_color_hover = $paramsC->get('border_color_hover', '#b36b00'); $highslide_class = $paramsC->get('highslide_class', 'rounded-white'); $highslide_opacity = $paramsC->get('highslide_opacity', 0); $highslide_outline_type = $paramsC->get('highslide_outline_type', 'rounded-white'); $highslide_fullimg = $paramsC->get('highslide_fullimg', 0); $highslide_slideshow = $paramsC->get('highslide_slideshow', 1); $highslide_close_button = $paramsC->get('highslide_close_button', 0); $display_rating_img = $paramsC->get('display_rating_img', 0); $float = ''; $enable_piclens = $paramsC->get('enable_piclens', 0); $enable_overlib = $paramsC->get('enable_oberlib', 0); // Image categories $img_cat = 1; $img_cat_size = 'small'; // Get plugin parameters $phocagallery = $matches[0][$i][0]; preg_match($regex_one, $phocagallery, $phocagallery_parts); $parts = explode("|", $phocagallery_parts[2]); $values_replace = array("/^'/", "/'\$/", "/^'/", "/'\$/", "/<br \\/>/"); foreach ($parts as $key => $value) { $values = explode("=", $value, 2); foreach ($values_replace as $key2 => $values2) { $values = preg_replace($values2, '', $values); } // Get plugin parameters from article if ($values[0] == 'view') { $view = $values[1]; } else { if ($values[0] == 'categoryid') { $catid = $values[1]; } else { if ($values[0] == 'imageid') { $imageid = $values[1]; } else { if ($values[0] == 'imagerandom') { $imagerandom = $values[1]; } else { if ($values[0] == 'imageshadow') { $image_background_shadow = $values[1]; } else { if ($values[0] == 'limitstart') { $limitstart = $values[1]; } else { if ($values[0] == 'limitcount') { $limitcount = $values[1]; } else { if ($values[0] == 'detail') { $detail_window = $values[1]; } else { if ($values[0] == 'displayname') { $display_name = $values[1]; } else { if ($values[0] == 'displaydetail') { $display_icon_detail = $values[1]; } else { if ($values[0] == 'displaydownload') { $display_icon_download = $values[1]; } else { if ($values[0] == 'displaybuttons') { $detail_buttons = $values[1]; } else { if ($values[0] == 'displayratingimg') { $display_rating_img = $values[1]; } else { if ($values[0] == 'namefontsize') { $namefontsize = $values[1]; } else { if ($values[0] == 'namenumchar') { $namenumchar = $values[1]; } else { if ($values[0] == 'displaydescription') { $display_description = $values[1]; } else { if ($values[0] == 'descriptionheight') { $description_height = $values[1]; } else { if ($values[0] == 'hidecategories') { $hide_categories = $values[1]; } else { if ($values[0] == 'boxspace') { $category_box_space = $values[1]; } else { if ($values[0] == 'fontcolor') { $font_color = $values[1]; } else { if ($values[0] == 'bgcolor') { $background_color = $values[1]; } else { if ($values[0] == 'bgcolorhover') { $background_color_hover = $values[1]; } else { if ($values[0] == 'imagebgcolor') { $image_background_color = $values[1]; } else { if ($values[0] == 'bordercolor') { $border_color = $values[1]; } else { if ($values[0] == 'bordercolorhover') { $border_color_hover = $values[1]; } else { if ($values[0] == 'hsclass') { $highslide_class = $values[1]; } else { if ($values[0] == 'hsopacity') { $highslide_opacity = $values[1]; } else { if ($values[0] == 'hsoutlinetype') { $highslide_outline_type = $values[1]; } else { if ($values[0] == 'hsfullimg') { $highslide_fullimg = $values[1]; } else { if ($values[0] == 'hsslideshow') { $highslide_slideshow = $values[1]; } else { if ($values[0] == 'hsclosebutton') { $highslide_close_button = $values[1]; } else { if ($values[0] == 'float') { $float = $values[1]; } else { if ($values[0] == 'imagecategories') { $img_cat = $values[1]; } else { if ($values[0] == 'imagecategoriessize') { $img_cat_size = $values[1]; } else { if ($values[0] == 'switchwidth') { $switch_width = $values[1]; } else { if ($values[0] == 'switchheight') { $switch_height = $values[1]; } else { if ($values[0] == 'basicimageid') { $basic_image_id = $values[1]; } else { if ($values[0] == 'enableswitch') { $enable_switch = $values[1]; } else { if ($values[0] == 'piclens') { $enable_piclens = $values[1]; } else { if ($values[0] == 'overlib') { $enable_overlib = $values[1]; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } // Every loop of plugin has own number // Add custom CSS for every image (every image can have other CSS, Hover doesn't work in IE6) $iCss = $this->_plugin_number; $cssPgPlugin .= " .pgplugin" . $iCss . " {border:1px solid {$border_color} ; background: {$background_color} ;}\n" . " .pgplugin" . $iCss . ":hover, .pgplugin" . $i . ".hover {border:1px solid {$border_color_hover} ; background: {$background_color_hover} ;}\n"; // PARAMS - direct from Phoca Gallery Global configuration $component = 'com_phocagallery'; $table =& JTable::getInstance('component'); $table->loadByOption($component); $paramsC = new JParameter($table->params); $tmpl['formaticon'] = $paramsC->get('icon_format', 'gif'); $medium_image_width = $paramsC->get('medium_image_width', 100); $medium_image_height = $paramsC->get('medium_image_height', 100); $popup_window_width = $paramsC->get('front_modal_box_width', 680); $popup_window_height = $paramsC->get('front_modal_box_height', 560); $small_image_width = $paramsC->get('small_image_width', 50); $small_image_height = $paramsC->get('small_image_height', 50); if ($display_description == 1) { $popup_window_height = $popup_window_height + $description_height; } // Detail buttons in detail view if ($detail_buttons != 1) { $popup_window_height = $popup_window_height - 45; } if ($display_rating_img == 1) { $popup_window_height = $popup_window_height + 35; } $modal_box_overlay_color = $paramsC->get('modal_box_overlay_color', '#000000'); $modal_box_overlay_opacity = $paramsC->get('modal_box_overlay_opacity', 0.3); $modal_box_border_color = $paramsC->get('modal_box_border_color', '#6b6b6b'); $modal_box_border_width = $paramsC->get('modal_box_border_width', 2); $tmpl['olbgcolor'] = $paramsC->get('ol_bg_color', '#666666'); $tmpl['olfgcolor'] = $paramsC->get('ol_fg_color', '#f6f6f6'); $tmpl['oltfcolor'] = $paramsC->get('ol_tf_color', '#000000'); $tmpl['olcfcolor'] = $paramsC->get('ol_cf_color', '#ffffff'); $tmpl['overliboverlayopacity'] = $paramsC->get('overlib_overlay_opacity', 0.7); // Window // ======================================================= // DIFFERENT METHODS OF DISPLAYING THE DETAIL VIEW // ======================================================= // MODAL - will be displayed in case e.g. highslide or shadowbox too, because in there are more links JHTML::_('behavior.modal', 'a.modal-button'); if ($cssSbox == '') { $cssSbox .= " #sbox-window {background-color:" . $modal_box_border_color . ";padding:" . $modal_box_border_width . "px} \n" . " #sbox-overlay {background-color:" . $modal_box_overlay_color . ";} \n"; } // BUTTON (IMAGE - standard, modal, shadowbox) $button = new JObject(); $button->set('name', 'image'); // BUTTON (ICON - standard, modal, shadowbox) $button2 = new JObject(); $button2->set('name', 'icon'); // BUTTON OTHER (geotagging, downloadlink, ...) $buttonOther = new JObject(); $buttonOther->set('name', 'other'); $tmpl['highslideonclick'] = ''; // for using with highslide // ------------------------------------------------------- // STANDARD POPUP // ------------------------------------------------------- if ($detail_window == 1) { $button->set('methodname', 'js-button'); $button->set('options', "window.open(this.href,'win2','width=" . $popup_window_width . ",height=" . $popup_window_height . ",menubar=no,resizable=yes'); return false;"); $button2->methodname =& $button->methodname; $button2->options =& $button->options; $buttonOther->methodname =& $button->methodname; $buttonOther->options =& $button->options; } else { if ($detail_window == 0 || $detail_window == 2) { // Button $button->set('modal', true); $button->set('methodname', 'modal-button'); $button2->modal =& $button->modal; $button2->methodname =& $button->methodname; $buttonOther->modal =& $button->modal; $buttonOther->methodname =& $button->methodname; // Modal - Image only if ($detail_window == 2) { $button->set('options', "{handler: 'image', size: {x: 200, y: 150}, overlayOpacity: " . $modal_box_overlay_opacity . ", classWindow: 'phocagallery-random-window', classOverlay: 'phocagallery-random-overlay'}"); $button2->options =& $button->options; $buttonOther->set('options', "{handler: 'iframe', size: {x: " . $popup_window_width . ", y: " . $popup_window_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . ", classWindow: 'phocagallery-random-window', classOverlay: 'phocagallery-random-overlay'}"); // Modal - Iframe } else { $button->set('options', "{handler: 'iframe', size: {x: " . $popup_window_width . ", y: " . $popup_window_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . ", classWindow: 'phocagallery-random-window', classOverlay: 'phocagallery-random-overlay'}"); $button2->options =& $button->options; $buttonOther->options =& $button->options; } } else { if ($detail_window == 3) { // Random Number - because of more plugins on the site $randName = 'PhocaGalleryPl' . $iCss; $randName2 = 'PhocaGalleryPl2' . $iCss; $sb_slideshow_delay = $paramsC->get('sb_slideshow_delay', 5); $sb_lang = $paramsC->get('sb_lang', 'en'); $button->set('methodname', 'shadowbox-button-rim'); $button->set('options', "shadowbox[" . $randName . "];options={slideshowDelay:" . $sb_slideshow_delay . "}"); $button2->methodname =& $button->methodname; $button2->set('options', "shadowbox[" . $randName2 . "];options={slideshowDelay:" . $sb_slideshow_delay . "}"); $buttonOther->set('modal', true); $buttonOther->set('methodname', 'modal-button'); $buttonOther->set('options', "{handler: 'iframe', size: {x: " . $popup_window_width . ", y: " . $popup_window_height . "}, overlayOpacity: " . $modal_box_overlay_opacity . ", classWindow: 'phocagallery-random-window', classOverlay: 'phocagallery-random-overlay'}"); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/adapter/shadowbox-mootools.js'); $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/shadowbox.js'); if ($libraries['pg-group-shadowbox']->value == 0) { $document->addCustomTag('<script type="text/javascript"> Shadowbox.loadSkin("classic", "' . JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/src/skin"); Shadowbox.loadLanguage("' . $sb_lang . '", "' . JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/src/lang"); Shadowbox.loadPlayer(["img"], "' . JURI::base(true) . '/components/com_phocagallery/assets/js/shadowbox/src/player"); window.onload = function(){ Shadowbox.init(); } </script>'); $library->setLibrary('pg-group-shadowbox', 1); } } else { if ($detail_window == 4) { $button->set('methodname', 'highslide'); $button2->methodname =& $button->methodname; $buttonOther->methodname =& $button->methodname; $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-full.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide.css'); if ($libraries['pg-group-highslide']->value == 0) { $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJSAll()); $document->addCustomTag('<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-ie6.css" /><![endif]-->'); $library->setLibrary('pg-group-highslide', 1); } $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJS('pl', $popup_window_width, $popup_window_height, $highslide_outline_type, $highslide_opacity)); $tmpl['highslideonclick'] = 'return hs.htmlExpand(this, phocaZoomPl )'; } else { if ($detail_window == 5) { $button->set('methodname', 'highslide'); $button2->methodname =& $button->methodname; $buttonOther->methodname =& $button->methodname; $document->addScript(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-full.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide.css'); if ($libraries['pg-group-highslide']->value == 0) { $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJSAll()); $document->addCustomTag('<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="' . JURI::base(true) . '/components/com_phocagallery/assets/js/highslide/highslide-ie6.css" /><![endif]-->'); $library->setLibrary('pg-group-highslide', 1); } $document->addCustomTag(PhocaGalleryRenderFront::renderHighslideJS('pl', $popup_window_width, $popup_window_height, $highslide_slideshow, $highslide_class, $highslide_outline_type, $highslide_opacity, $highslide_close_button)); $tmpl['highslideonclick2'] = 'return hs.htmlExpand(this, phocaZoomPl )'; $tmpl['highslideonclick'] = 'return hs.expand(this, phocaImageRI )'; $tmpl['highslideonclick'] = PhocaGalleryRenderFront::renderHighslideJSImage('pl', $highslide_class, $highslide_outline_type, $highslide_opacity, $highslide_fullimg); } } } } } $folderButton = new JObject(); $folderButton->set('name', 'image'); $folderButton->set('options', ""); // End open window parameters // =============================== // OUTPUT // =============================== $output = ''; $output .= '<div class="phocagallery">' . "\n"; //-------------------------- // DISPLAYING OF CATEGORIES (link doesn't work if there is no menu link) //-------------------------- $hideCat = trim($hide_categories); $hideCatArray = explode(';', $hide_categories); $hideCatSql = ''; if (is_array($hideCatArray)) { foreach ($hideCatArray as $value) { $hideCatSql .= ' AND cc.id != ' . (int) trim($value) . ' '; } } // by vogo $uniqueCatSql = ''; if ($catid > 0) { $uniqueCatSql = ' AND cc.id = ' . $catid . ''; } if ($view == 'categories') { //CATEGORIES $queryc = 'SELECT cc.*, a.catid, COUNT(a.id) AS numlinks,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as slug' . ' FROM #__phocagallery_categories AS cc' . ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id' . ' WHERE a.published = 1' . ' AND cc.published = 1' . $hideCatSql . $uniqueCatSql . ' GROUP BY cc.id' . ' ORDER BY cc.ordering'; //SUBCATEGORIES $querysc = 'SELECT cc.title AS text, cc.id AS value, cc.parent_id as parentid' . ' FROM #__phocagallery_categories AS cc' . ' WHERE cc.published = 1' . ' ORDER BY cc.ordering'; $data_outcome = ''; $data_outcome_array = ''; $db->setQuery($queryc); $outcome_data = $db->loadObjectList(); $db->setQuery($querysc); $outcome_subcategories = $db->loadObjectList(); $tree = array(); $text = ''; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($outcome_subcategories, $tree, 0, $text, -1); foreach ($tree as $key => $value) { foreach ($outcome_data as $key2 => $value2) { if ($value->value == $value2->id) { $data_outcome = new JObject(); $data_outcome->id = $value2->id; $data_outcome->parent_id = $value2->parent_id; $data_outcome->title = $value->text; $data_outcome->name = $value2->name; $data_outcome->alias = $value2->alias; $data_outcome->image = $value2->image; $data_outcome->section = $value2->section; $data_outcome->image_position = $value2->image_position; $data_outcome->description = $value2->description; $data_outcome->published = $value2->published; $data_outcome->editor = $value2->editor; $data_outcome->ordering = $value2->ordering; $data_outcome->access = $value2->access; $data_outcome->accessuserid = $value2->accessuserid; $data_outcome->uploaduserid = $value2->uploaduserid; $data_outcome->deleteuserid = $value2->deleteuserid; $data_outcome->count = $value2->count; $data_outcome->params = $value2->params; $data_outcome->catid = $value2->catid; $data_outcome->numlinks = $value2->numlinks; $data_outcome->slug = $value2->slug; $data_outcome->link = ""; $data_outcome->filename = ""; $data_outcome->linkthumbnailpath = ""; //FILENAME $queryfn = 'SELECT filename AS filename FROM #__phocagallery WHERE catid=' . $value2->id . ' AND published=1 ORDER BY ordering LIMIT 1'; $db->setQuery($queryfn); $outcome_filename = $db->loadObjectList(); $data_outcome->filename = $outcome_filename[0]->filename; $data_outcome_array[] = $data_outcome; } } } if ($img_cat == 1) { $medium_image_height = $medium_image_height + 18; $medium_image_width = $medium_image_width + 18; $small_image_width = $small_image_width + 18; $small_image_height = $small_image_height + 18; $output .= '<table border="0">'; foreach ($data_outcome_array as $category) { // -------------------------------------------------------------- SEF PROBLEM // Is there a Itemid for category $items = $menu->getItems('link', 'index.php?option=com_phocagallery&view=category&id=' . $category->id); $itemscat = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories'); if (isset($itemscat[0])) { $itemid = $itemscat[0]->id; $category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug . '&Itemid=' . $itemid); } else { if (isset($items[0])) { $itemid = $items[0]->id; $category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug . '&Itemid=' . $itemid); } else { $itemid = 0; //$category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id='. $category->slug.'&Itemid='.$itemid ); $category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug); } } // --------------------------------------------------------------------------------- $imgCatSizeHelper = 'small'; $mediumCSS = 'background: url(\'' . JURI::base(true) . '/components/com_phocagallery/assets/images/shadow1.' . $tmpl['formaticon'] . '\') 50% 50% no-repeat;height:' . $medium_image_height . 'px;width:' . $medium_image_width . 'px;'; $smallCSS = 'background: url(\'' . JURI::base(true) . '/components/com_phocagallery/assets/images/shadow3.' . $tmpl['formaticon'] . '\') 50% 50% no-repeat;height:' . $small_image_height . 'px;width:' . $small_image_width . 'px;'; switch ($img_cat_size) { case 'mediumfoldershadow': $imageBg = $mediumCSS; $imgCatSizeHelper = 7; break; case 'smallfoldershadow': $imageBg = $smallCSS; $imgCatSizeHelper = 6; break; case 'mediumshadow': $imageBg = $mediumCSS; $imgCatSizeHelper = 5; break; case 'smallshadow': $imageBg = $smallCSS; $imgCatSizeHelper = 4; break; case 'mediumfolder': $imageBg = ''; $imgCatSizeHelper = 3; break; case 'smallfolder': default: $imageBg = ''; $imgCatSizeHelper = 2; break; case 'medium': $imageBg = ''; $imgCatSizeHelper = 1; break; case 'small': default: $imageBg = ''; $imgCatSizeHelper = 0; break; } // Display Key Icon (in case we want to display unaccessable categories in list view) $rightDisplayKey = 1; // we simulate that we want not to display unaccessable categories // so we get rightDisplayKey = 0 then the key will be displayed if (isset($category)) { $rightDisplayKey = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, $category->access, $user->get('aid', 0), $user->get('id', 0), 0); } $file_thumbnail = PhocaGalleryImageFront::displayCategoriesImageOrFolder($category->filename, $imgCatSizeHelper, $rightDisplayKey); $category->linkthumbnailpath = $file_thumbnail->rel; //Output $output .= '<tr>' . '<td align="center" valign="middle" style="' . $imageBg . '"><a href="' . $category->link . '">' . '<img src="' . $category->linkthumbnailpath . '" alt="' . $category->title . '" style="border:0" />' . '</a></td>' . '<td><a href="' . $category->link . '" class="category' . $params->get('pageclass_sfx') . '">' . $category->title . '</a> ' . '<span class="small">(' . $category->numlinks . ')</span></td>' . '</tr>'; } $output .= '</table>'; } else { $output .= '<ul>'; foreach ($data_outcome_array as $category) { // -------------------------------------------------------------- SEF PROBLEM // Is there a Itemid for category $items = $menu->getItems('link', 'index.php?option=com_phocagallery&view=category&id=' . $category->id); $itemscat = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories'); if (isset($itemscat[0])) { $itemid = $itemscat[0]->id; $category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug . '&Itemid=' . $itemid); } else { if (isset($items[0])) { $itemid = $items[0]->id; $category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug . '&Itemid=' . $itemid); } else { $itemid = 0; $category->link = JRoute::_('index.php?option=com_phocagallery&view=category&id=' . $category->slug); } } // --------------------------------------------------------------------------------- $output .= '<li>' . '<a href="' . $category->link . '" class="category' . $params->get('pageclass_sfx') . '">' . $category->title . '</a> <span class="small">(' . $category->numlinks . ')</span>' . '</li>'; } $output .= '</ul>'; } } //----------------------- // DISPLAYING OF IMAGES //----------------------- if ($view == 'category') { $where = ''; // Only one image if ($imageid > 0) { $where = ' AND id = ' . $imageid; } // Random image if ($imagerandom == 1 && $catid > 0) { $query = 'SELECT id' . ' FROM #__phocagallery' . ' WHERE catid = ' . (int) $catid . ' AND published = 1' . ' ORDER BY RAND()'; $db->setQuery($query); $idQuery =& $db->loadObject(); if (!empty($idQuery)) { $where = ' AND id = ' . $idQuery->id; } } $limit = ''; // Count of images (LIMIT 0, 20) if ($limitcount > 0) { $limit = ' LIMIT ' . $limitstart . ', ' . $limitcount; } $query = 'SELECT *' . ' FROM #__phocagallery' . ' WHERE catid = ' . (int) $catid . ' AND published = 1' . $where . ' ORDER BY ordering' . $limit; $db->setQuery($query); $category =& $db->loadObjectList(); // current category info $query = 'SELECT c.*,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug ' . ' FROM #__phocagallery_categories AS c' . ' WHERE c.id = ' . (int) $catid; // ' AND c.section = "com_phocagallery"'; $db->setQuery($query, 0, 1); $category_info = $db->loadObject(); // Output foreach ($category as $image) { // PicLens CATEGORY - loaded every time new category will be displayed on the site--------- if ((int) $enable_piclens > 0) { $libName = 'pg-piclens-' . $image->catid; $libraries[$libName] = $library->getLibrary($libName); if ($libraries[$libName]->value == 0) { $document->addCustomTag("<link id=\"phocagallerypiclens\" rel=\"alternate\" href=\"" . JURI::base(true) . "/images/phocagallery/" . $image->catid . ".rss\" type=\"application/rss+xml\" title=\"\" />"); $library->setLibrary($libName, 1); } // PicLens CSS - will be loaded only one time per site $libraries[$libName] = $library->getLibrary('pg-pl-piclens'); if ($libraries['pg-pl-piclens']->value == 0) { $document->addScript('http://lite.piclens.com/current/piclens.js'); $document->addCustomTag("<style type=\"text/css\">\n" . " .mbf-item { display: none; }\n" . " #phocagallery .mbf-item { display: none; }\n" . " </style>\n"); $library->setLibrary('pg-pl-piclens', 1); } } // END PICLENS ----------------------------------------------------------------------------- $image->slug = $image->id . '-' . $image->alias; // Get file thumbnail or No Image $image->linkthumbnailpath = PhocaGalleryImageFront::displayImageOrNoImage($image->filename, 'medium'); $file_thumbnail = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, 'medium'); $image->linkthumbnailpathabs = $file_thumbnail->abs; // -------------------------------------------------------------- SEF PROBLEM // Is there a Itemid for category $items = $menu->getItems('link', 'index.php?option=com_phocagallery&view=category&id=' . $category_info->id); $itemscat = $menu->getItems('link', 'index.php?option=com_phocagallery&view=categories'); if (isset($itemscat[0])) { $itemid = $itemscat[0]->id; $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category_info->slug . '&id=' . $image->slug . '&Itemid=' . $itemid . '&tmpl=component&detail=' . $detail_window . '&buttons=' . $detail_buttons); } else { if (isset($items[0])) { $itemid = $items[0]->id; $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category_info->slug . '&id=' . $image->slug . '&Itemid=' . $itemid . '&tmpl=component&detail=' . $detail_window . '&buttons=' . $detail_buttons); } else { $itemid = 0; $siteLink = JRoute::_('index.php?option=com_phocagallery&view=detail&catid=' . $category_info->slug . '&id=' . $image->slug . '&tmpl=component&detail=' . $detail_window . '&buttons=' . $detail_buttons); } } // --------------------------------------------------------------------------------- // Different links for different actions: image, zoom icon, download icon $thumbLink = PhocaGalleryFileThumbnail::getThumbnailName($image->filename, 'large'); $imgLinkOrig = JURI::base(true) . '/' . PhocaGalleryFile::getFileOriginal($image->filename, 1); $imgLink = $thumbLink->rel; if ($detail_window == 2) { $image->link = $imgLink; $image->link2 = $imgLink; $image->linkother = $siteLink; $image->linkorig = $imgLinkOrig; } else { if ($detail_window == 3) { $image->link = $imgLink; $image->link2 = $imgLink; $image->linkother = $siteLink; $image->linkorig = $imgLinkOrig; } else { if ($detail_window == 5) { $image->link = $imgLink; $image->link2 = $siteLink; $image->linkother = $siteLink; $image->linkorig = $imgLinkOrig; } else { $image->link = $siteLink; $image->link2 = $siteLink; $image->linkother = $siteLink; $image->linkorig = $imgLinkOrig; } } } // Float $float_code = ''; if ($float != '') { $float_code = 'position:relative;float:' . $float . ';'; } // Maximum size of module image is 100 x 100 jimport('joomla.filesystem.file'); $imageWidth['size'] = 100; $imageHeight['size'] = 100; $imageHeight['boxsize'] = 100; $imageWidth['boxsize'] = 120; $imageOrigHeight = 100; $imageOrigWidth = 100; if (JFile::exists($image->linkthumbnailpathabs)) { list($width, $height) = GetImageSize($image->linkthumbnailpathabs); $imageHeight = PhocaGalleryImage::correctSize($height, 100, 100, 0); $imageWidth = PhocaGalleryImage::correctSize($width, 100, 120, 20); $imageOrigHeight = $height; $imageOrigWidth = $width; } $imageHeight['boxsize'] = PhocaGalleryImage::setBoxSize($imageHeight, $imageWidth, $display_name, $display_icon_detail, $display_icon_download, 0, 0, 0, 0, 0, 0, 0, 0, $category_box_space, $image_background_shadow, 0); if ($image_background_shadow != 'none') { $imageHeight['size'] = $imageHeight['size'] + 18; $imageWidth['size'] = $imageWidth['size'] + 18; $image_background_color = 'url(\'' . JURI::base(true) . '/components/com_phocagallery/assets/images/' . $image_background_shadow . '.' . $tmpl['formaticon'] . '\') 0 0 no-repeat;'; } $output .= '<div class="phocagallery-box-file pgplugin' . $iCss . '" style="height:' . $imageHeight['boxsize'] . 'px; width:' . $imageWidth['boxsize'] . 'px;' . $float_code . '">' . "\n" . '<center>' . "\n" . '<div class="phocagallery-box-file-first" style="background: ' . $image_background_color . ';height:' . $imageHeight['size'] . 'px;width:' . $imageWidth['size'] . 'px;">' . "\n" . '<div class="phocagallery-box-file-second">' . "\n" . '<div class="phocagallery-box-file-third">' . "\n" . '<center>' . "\n" . '<a class="' . $button->methodname . '" title="' . $image->title . '" href="' . JRoute::_($image->link) . '"'; // DETAIL WINDOW if ($detail_window == 1) { $output .= ' onclick="' . $button->options . '"'; } else { if ($detail_window == 4 || $detail_window == 5) { $highSlideOnClick = str_replace('[phocahsfullimg]', $image->linkorig, $tmpl['highslideonclick']); $output .= ' onclick="' . $highSlideOnClick . '"'; } else { $output .= ' rel="' . $button->options . '"'; } } // Enable the switch image if ($enable_switch == 1) { $output .= ' onmouseover="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \'' . str_replace('phoca_thumb_m_', 'phoca_thumb_l_', JURI::root() . $image->linkthumbnailpath) . '\');" onmouseout="PhocaGallerySwitchImage(\'PhocaGalleryobjectPicture\', \'' . str_replace('phoca_thumb_m_', 'phoca_thumb_l_', JURI::root() . $image->linkthumbnailpath) . '\');"'; } else { // Overlib if (!empty($image->description)) { $divPadding = 'padding:5px;'; } else { $divPadding = 'padding:0px;margin:0px;'; } $document->addScript(JURI::base(true) . '/includes/js/overlib_mini.js'); $opacityPer = $opacityPer = (double) $tmpl['overliboverlayopacity'] * 100; if ($libraries['pg-overlib-group']->value == 0) { $document->addCustomTag("<style type=\"text/css\">\n" . ".bgPhocaClass{\r\n\t\t\t\t\t\t\t\tbackground:" . $tmpl['olbgcolor'] . ";\r\n\t\t\t\t\t\t\t\tfilter:alpha(opacity=" . $opacityPer . ");\r\n\t\t\t\t\t\t\t\topacity: " . $tmpl['overliboverlayopacity'] . ";\r\n\t\t\t\t\t\t\t\t-moz-opacity:" . $tmpl['overliboverlayopacity'] . ";\r\n\t\t\t\t\t\t\t\tz-index:1000;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t.fgPhocaClass{\r\n\t\t\t\t\t\t\t\tbackground:" . $tmpl['olfgcolor'] . ";\r\n\t\t\t\t\t\t\t\tfilter:alpha(opacity=100);\r\n\t\t\t\t\t\t\t\topacity: 1;\r\n\t\t\t\t\t\t\t\t-moz-opacity:1;\r\n\t\t\t\t\t\t\t\tz-index:1000;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t.fontPhocaClass{\r\n\t\t\t\t\t\t\t\tcolor:" . $tmpl['oltfcolor'] . ";\r\n\t\t\t\t\t\t\t\tz-index:1001;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t.capfontPhocaClass, .capfontclosePhocaClass{\r\n\t\t\t\t\t\t\t\tcolor:" . $tmpl['olcfcolor'] . ";\r\n\t\t\t\t\t\t\t\tfont-weight:bold;\r\n\t\t\t\t\t\t\t\tz-index:1001;\r\n\t\t\t\t\t\t\t\t}" . " </style>\n"); $library->setLibrary('pg-overlib-group', 1); } if ($enable_overlib == 1) { $output .= " onmouseover=\"return overlib('" . htmlspecialchars(addslashes('<center>' . JHTML::_('image.site', str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $image->linkthumbnailpath), '', '', '', $image->title) . "</center>")) . "', CAPTION, '" . $image->title . "', BELOW, RIGHT, BGCLASS,'bgPhocaClass', FGCOLOR, '" . $tmpl['olfgcolor'] . "', BGCOLOR, '" . $tmpl['olbgcolor'] . "', TEXTCOLOR, '" . $tmpl['oltfcolor'] . "', CAPCOLOR, '" . $tmpl['olcfcolor'] . "');\"" . " onmouseout=\"return nd();\" "; } else { if ($enable_overlib == 2) { $image->description = str_replace("\n", '<br />', $image->description); $output .= " onmouseover=\"return overlib('" . htmlspecialchars(addslashes('<div style="' . $divPadding . '">' . $image->description . '</div>')) . "', CAPTION, '" . $image->title . "', BELOW, RIGHT, CSSCLASS, TEXTFONTCLASS, 'fontPhocaClass', FGCLASS, 'fgPhocaClass', BGCLASS, 'bgPhocaClass', CAPTIONFONTCLASS,'capfontPhocaClass', CLOSEFONTCLASS, 'capfontclosePhocaClass');\"" . " onmouseout=\"return nd();\" "; } else { if ($enable_overlib == 3) { $image->description = str_replace("\n", '<br />', $image->description); $output .= " onmouseover=\"return overlib('" . PhocaGalleryText::strTrimAll(htmlspecialchars(addslashes('<div style="text-align:center"><center>' . JHTML::_('image.site', str_replace('phoca_thumb_m_', 'phoca_thumb_l_', $image->linkthumbnailpath), '', '', '', $image->title) . '</center></div><div style="' . $divPadding . '">' . $image->description . '</div>'))) . "', CAPTION, '" . $image->title . "', BELOW, RIGHT, BGCLASS,'bgPhocaClass', FGCLASS,'fgPhocaClass', FGCOLOR, '" . $tmpl['olfgcolor'] . "', BGCOLOR, '" . $tmpl['olbgcolor'] . "', TEXTCOLOR, '" . $tmpl['oltfcolor'] . "', CAPCOLOR, '" . $tmpl['olcfcolor'] . "');\"" . " onmouseout=\"return nd();\" "; } } } } // End Overlib $output .= ' >' . "\n"; $output .= '<img src="' . $image->linkthumbnailpath . '" alt="' . $image->title . '" />'; if ((int) $enable_piclens > 0) { $output .= '<span class="mbf-item">#phocagallerypiclens ' . $image->catid . '-phocagallerypiclenscode-' . $image->filename . '</span>'; } $output .= '</a>' . '</center>' . "\n" . '</div>' . "\n" . '</div>' . "\n" . '</div>' . "\n" . '</center>' . "\n"; if ($display_name == 1) { $output .= '<div class="name" style="color: ' . $font_color . ' ;font-size:' . $namefontsize . 'px;margin-top:5px;text-align:center;">' . PhocaGalleryText::wordDelete($image->title, $namenumchar, '...') . '</div>'; } if ($display_icon_detail == 1 || $display_icon_download == 1 || $enable_piclens == 2) { $output .= '<div class="detail" style="text-align:right">'; if ($enable_piclens == 2) { $output .= ' <a href="javascript:PicLensLite.start();" title="PicLens" ><img src="http://lite.piclens.com/images/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" style="margin-bottom:2px" /></a>'; } if ($display_icon_detail == 1) { $output .= ' <a class="' . $button->methodname . '" title="' . JText::_('Image Detail') . '" href="' . JRoute::_($image->link2) . '"'; // Detail Window if ($detail_window == 1) { $output .= ' onclick="' . $button->options . '"'; } else { if ($detail_window == 2) { $output .= ' rel="' . $button->options . '"'; } else { if ($detail_window == 4) { $output .= ' onclick="' . $tmpl['highslideonclick'] . '"'; } else { if ($detail_window == 5) { $output .= ' onclick="' . $tmpl['highslideonclick2'] . '"'; } else { $output .= ' rel="' . $button2->options . '"'; } } } } $output .= ' >'; $output .= '<img src="components/com_phocagallery/assets/images/icon-view.' . $tmpl['formaticon'] . '" alt="' . $image->title . '" />'; $output .= '</a>'; } if ($display_icon_download == 1) { $output .= ' <a class="' . $button->methodname . '" title="' . JText::_('Image Download') . '" href="' . JRoute::_($image->linkother . '&phocadownload=1') . '"'; // Detail Window if ($detail_window == 1) { $output .= ' onclick="' . $buttonOther->options . '"'; } else { if ($detail_window == 4) { $output .= ' onclick="' . $tmpl['highslideonclick'] . '"'; } else { if ($detail_window == 5) { $output .= ' onclick="' . $tmpl['highslideonclick2'] . '"'; } else { $output .= ' rel="' . $buttonOther->options . '"'; } } } $output .= ' >'; $output .= '<img src="components/com_phocagallery/assets/images/icon-download.' . $tmpl['formaticon'] . '" alt="' . $image->title . '" />'; $output .= '</a>'; } $output .= '</div>'; if ($float == '') { $output .= '<div style="clear:both"> </div>'; } } $output .= '</div>'; } } //-------------------------- // DISPLAYING OF SWITCHIMAGE //-------------------------- if ($view == 'switchimage') { $path = PhocaGalleryPath::getPath(); $waitImage = $path->image_rel . 'icon-switch.gif'; $basicImage = $path->image_rel . 'phoca_thumb_l_no_image.' . $tmpl['formaticon']; if ($basic_image_id > 0) { $query = 'SELECT *' . ' FROM #__phocagallery' . ' WHERE id = ' . (int) $basic_image_id; $db->setQuery($query); $basicImageArray =& $db->loadObject(); if (isset($basicImageArray->filename)) { $fileBasicThumb = PhocaGalleryFileThumbnail::getThumbnailName($basicImageArray->filename, 'large'); $basicImage = $fileBasicThumb->rel; } else { $basicImage = ''; } } $switchHeight = $switch_height; //$this->switchheight; $switchCenterH = $switchHeight / 2 - 18; $switchWidth = $switch_width; //$this->switchwidth; $switchCenterW = $switchWidth / 2 - 18; $document->addCustomTag(PhocaGalleryRenderFront::switchImage($waitImage)); $switchHeight = $switchHeight + 5; $output .= '<div><center class="main-switch-image" style="margin:0px;padding:7px 5px 7px 5px;margin-bottom:15px;"><table border="0" cellspacing="5" cellpadding="5" style="border:1px solid #c2c2c2;"><tr><td align="center" valign="middle" style="text-align:center;width:' . $switchWidth . 'px;height:' . $switchHeight . 'px; background: url(\'' . JURI::root() . 'components/com_phocagallery/assets/images/icon-switch.gif\') ' . $switchCenterW . 'px ' . $switchCenterH . 'px no-repeat;margin:0px;padding:0px;"> ' . JHTML::_('image.site', $basicImage, '', '', '', '', ' id="PhocaGalleryobjectPicture" border="0"') . ' </td></tr></table></center></div>'; } else { // Overlib } //-------------------------- // DISPLAYING OF Clear Both //-------------------------- if ($view == 'clearboth') { $output .= '<div style="clear:both"> </div>'; } if ($view == 'clearright') { $output .= '<div style="clear:right"> </div>'; } if ($view == 'clearleft') { $output .= '<div style="clear:left"> </div>'; } $output .= '</div>'; if ($float == '') { $output .= '<div style="clear:both"> </div>'; } $article->text = preg_replace($regex_all, $output, $article->text, 1); } // CUSTOM CSS - For all items it will be the same if ($libraries['pg-css-sbox-plugin']->value == 0) { $document->addCustomTag("<style type=\"text/css\">\n" . $cssSbox . "\n" . " </style>\n"); $library->setLibrary('pg-css-sbox-plugin', 1); } // All custom CSS tags will be added into one CSS area if ($libraries['pg-css-pg-plugin']->value == 0) { $document->addCustomTag("<style type=\"text/css\">\n" . $cssPgPlugin . "\n" . " </style>\n"); $library->setLibrary('pg-css-pg-plugin', 1); } if ($libraries['pg-css-ie']->value == 0) { $document->addCustomTag("<!--[if lt IE 8]>\n<link rel=\"stylesheet\" href=\"" . JURI::base(true) . "/components/com_phocagallery/assets/phocagalleryieall.css\" type=\"text/css\" />\n<![endif]-->"); $library->setLibrary('pg-css-ie', 1); } } // end if count_matches return true; }
function display($tpl = null) { $app = JFactory::getApplication(); //Frontend Changes $tUri = ''; $jsLink = JURI::base(true); if (!$app->isAdmin()) { $tUri = JURI::base(); phocagalleryimport('phocagallery.render.renderadmin'); phocagalleryimport('phocagallery.file.filethumbnail'); $jsLink = JURI::base(true) . '/administrator'; } $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); $db =& JFactory::getDBO(); JHTML::stylesheet('administrator/components/com_phocagallery/assets/phocagallery.css'); JHTML::stylesheet('administrator/components/com_phocagallery/assets/jcp/picker.css'); $document->addScript($jsLink . '/components/com_phocagallery/assets/jcp/picker.js'); $eName = JRequest::getVar('e_name'); $tmpl['ename'] = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName); $tmpl['type'] = JRequest::getVar('type', 1, '', 'int'); $tmpl['backlink'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinks&tmpl=component&e_name=' . $tmpl['ename']; $document->addCustomTag("<!--[if lt IE 8]>\n<link rel=\"stylesheet\" href=\"../administrator/components/com_phocagallery/assets/phocagalleryieall.css\" type=\"text/css\" />\n<![endif]-->"); $params = JComponentHelper::getParams('com_phocagallery'); //Filter $filter_state = $app->getUserStateFromRequest($this->_context . '.filter_state', 'filter_state', '', 'word'); $filter_catid = $app->getUserStateFromRequest($this->_context . '.filter_catid', 'filter_catid', 0, 'int'); $filter_order = $app->getUserStateFromRequest($this->_context . '.filter_order', 'filter_order', 'a.ordering', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest($this->_context . '.filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $app->getUserStateFromRequest($this->_context . '.search', 'search', '', 'string'); $search = JString::strtolower($search); // Get data from the model $items =& $this->get('Data'); $total =& $this->get('Total'); $tmpl['pagination'] =& $this->get('Pagination'); // build list of categories $javascript = 'class="inputbox" size="1" onchange="submitform( );"'; // get list of categories for dropdown filter $filter = ''; // build list of categories $javascript = 'class="inputbox" size="1" onchange="submitform( );"'; $query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocagallery_categories AS a' . ' WHERE a.published = 1' . ' AND a.approved = 1' . ' ORDER BY a.ordering'; $db->setQuery($query); $phocagallerys = $db->loadObjectList(); $tree = array(); $text = ''; $tree = PhocaGalleryRenderAdmin::CategoryTreeOption($phocagallerys, $tree, 0, $text, -1); array_unshift($tree, JHTML::_('select.option', '0', '- ' . JText::_('COM_PHOCAGALLERY_SELECT_CATEGORY') . ' -', 'value', 'text')); $lists['catid'] = JHTML::_('select.genericlist', $tree, 'filter_catid', $javascript, 'value', 'text', $filter_catid); //----------------------------------------------------------------------- // state filter $lists['state'] = JHTML::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $this->assignRef('tmpl', $tmpl); $this->assignRef('button', $button); $this->assignRef('user', JFactory::getUser()); $this->assignRef('items', $items); $this->assignRef('request_url', $uri->toString()); switch ($tmpl['type']) { case 2: $i = 0; $itemsCount = $itemsStart = array(); foreach ($items as $key => $value) { $itemsCount[$i] = new StdClass(); $itemsCount[$i]->value = $key; $itemsCount[$i]->text = $key; $itemsStart[$i] = new StdClass(); $itemsStart[$i]->value = $key; $itemsStart[$i]->text = $key; $i++; } // Don't display it if no category is selected if ($i > 0) { $itemsCount[$i] = new StdClass(); $itemsCount[$i]->value = (int) $key + 1; $itemsCount[$i]->text = (int) $key + 1; } $categoryId = JRequest::getVar('filter_catid', 0, '', 'int'); $categoryIdList = $app->getUserStateFromRequest($this->_context . '.filter_catid', 'filter_catid', 0, 'int'); if ((int) $categoryId == 0 && $categoryIdList == 0) { $itemsCount = $itemsStart = array(); } $lists['limitstartparam'] = JHTML::_('select.genericlist', $itemsStart, 'limitstartparam', '', 'value', 'text', ''); $lists['limitcountparam'] = JHTML::_('select.genericlist', $itemsCount, 'limitcountparam', '', 'value', 'text', ''); $this->assignRef('lists', $lists); parent::display('images'); break; case 3: $this->assignRef('lists', $lists); parent::display('switchimage'); break; case 4: $this->assignRef('lists', $lists); parent::display('slideshow'); break; case 1: default: $this->assignRef('lists', $lists); parent::display($tpl); break; } }
} ?> <div style="clear:both"> </div> <p> </p> <?php /* <div style="text-align:center;padding:0;margin:0;border:0"> <iframe style="padding:0;margin:0;border:0" src="http://www.phoca.cz/adv/phocagallery" noresize="noresize" frameborder="0" border="0" cellspacing="0" scrolling="no" width="500" marginwidth="0" marginheight="0" height="125"> <a href="http://www.phoca.cz/adv/phocagallery" target="_blank">Phoca Gallery</a> </iframe> </div> */ ?> <div class="alert alert-block alert-info ph-w80"> <button type="button" class="close" data-dismiss="alert">×</button> <?php echo PhocaGalleryRenderAdmin::getLinks(); ?> </div> </div> </div> <div class="pga-cpanel-right"> <div class="well"> <div style="float:right;margin:10px;"> <?php echo JHTML::_('image', 'media/com_phocagallery/images/administrator/logo-phoca.png', 'Phoca.cz'); ?> </div> <?php echo '<h3>' . JText::_('COM_PHOCAGALLERY_VERSION') . '</h3>' . '<p>' . $this->t['version'] . '</p>';