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); }
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); }
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'); }
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); }