Beispiel #1
0
 function display($tpl = null)
 {
     global $mainframe;
     $uri =& JFactory::getURI();
     $document =& JFactory::getDocument();
     $db =& JFactory::getDBO();
     JHTML::stylesheet('phocagallery.css', 'administrator/components/com_phocagallery/assets/');
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('Phoca Gallery Comments'), 'comment');
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::deleteList(JText::_('WARNWANTDELLISTEDITEMS'), 'remove', 'delete');
     JToolBarHelper::editListX();
     JToolBarHelper::addNewX();
     JToolBarHelper::help('screen.phocagallery', true);
     //Filter
     $context = 'com_phocagallery.phocagalleryco.list.';
     $filter_state = $mainframe->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'word');
     $filter_catid = $mainframe->getUserStateFromRequest($context . 'filter_catid', 'filter_catid', 0, 'int');
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'a.ordering', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     // Get data from the model
     $items =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     // 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' . ' ORDER BY a.ordering';
     $db->setQuery($query);
     $phocagallerys = $db->loadObjectList();
     $tree = array();
     $text = '';
     $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);
     $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, 0);
     array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- ' . JText::_('Select Category') . ' -', 'value', 'text'));
     //list categories
     $lists['catid'] = JHTML::_('select.genericlist', $phocagallerys_tree_array, '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('user', JFactory::getUser());
     $this->assignRef('lists', $lists);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
Beispiel #2
0
 function getData()
 {
     if (empty($this->_data) && empty($this->_data_categories)) {
         $query = $this->_buildQuery();
         $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
         $query_sub = $this->_buildQuerySubcategories();
         // We need all data (id, parentid,text) without limitation
         // because of creating correct tree, e.g: user hase pagination 10
         // and he hase one category and 15 subcategories, on the second
         // site he must get information about the parent category
         // not limitation required (but there are only 3 items)
         //	$this->_data_categories = $this->_getList($query_sub, $this->getState('limitstart'), $this->getState('limit'));
         $this->_data_categories = $this->_getList($query_sub);
         $user =& JFactory::getUser();
         $tree = array();
         $text = '';
         $tree = PhocaGalleryHelper::CategoryTree($this->_data_categories, $tree, 0, $text);
         $this->_data_categories = PhocaGalleryHelper::CategoryTreeCreating($this->_data_categories, $tree, 0);
         foreach ($this->_data_categories as $key => $value) {
             foreach ($this->_data as $key2 => $value2) {
                 if ($value->value == $value2->id) {
                     $this->_data_outcome = new JObject();
                     $this->_data_outcome->id = $value2->id;
                     $this->_data_outcome->parent_id = $value2->parent_id;
                     $this->_data_outcome->title = $value->text;
                     //$value2->title;
                     $this->_data_outcome->name = $value2->name;
                     $this->_data_outcome->alias = $value2->alias;
                     $this->_data_outcome->image = $value2->image;
                     $this->_data_outcome->section = $value2->section;
                     $this->_data_outcome->image_position = $value2->image_position;
                     $this->_data_outcome->description = $value2->description;
                     $this->_data_outcome->published = $value2->published;
                     $this->_data_outcome->editor = $value2->editor;
                     $this->_data_outcome->ordering = $value2->ordering;
                     $this->_data_outcome->access = $value2->access;
                     $this->_data_outcome->count = $value2->count;
                     $this->_data_outcome->hits = $value2->hits;
                     $this->_data_outcome->params = $value2->params;
                     $this->_data_outcome->checked_out = $value2->checked_out;
                     $this->_data_outcome->groupname = $value2->groupname;
                     $this->_data_outcome->parentname = $value2->parentname;
                     $this->_data_outcome->ratingavg = $value2->ratingavg;
                     $this->_data_outcome->usercatname = $value2->usercatname;
                     $this->_data_outcome_array[] = $this->_data_outcome;
                 }
             }
         }
         $this->_data = $this->_data_outcome_array;
     }
     return $this->_data;
 }
Beispiel #3
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $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();
     $tree = array();
     $text = '';
     $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);
     $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, 0);
     array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- ' . JText::_('Select Category') . ' -', 'value', 'text'));
     //	array_unshift($gallerys, JHTML::_('select.option', '0', '- '.JText::_('Select gallery').' -', 'value', 'text'));
     return JHTML::_('select.genericlist', $phocagallerys_tree_array, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $control_name . $name);
 }
Beispiel #4
0
 function CategoryTree($data, $tree, $id = 0, $text = '')
 {
     foreach ($data as $key) {
         $show_text = $text . $key->text;
         if ($key->parentid == $id) {
             $tree[$key->value] = $show_text;
             $tree = PhocaGalleryHelper::CategoryTree($data, $tree, $key->value, $show_text . " » ");
         }
     }
     return $tree;
 }
Beispiel #5
0
 function _displayForm($tpl)
 {
     global $mainframe, $option;
     $uri =& JFactory::getURI();
     $phocagallery =& $this->get('Data');
     //Data from model
     $lists = array();
     $db =& JFactory::getDBO();
     $document =& JFactory::getDocument();
     $params =& JComponentHelper::getParams('com_phocagallery');
     JToolBarHelper::title(JText::_('Phoca gallery') . ': <small><small>[ ' . JText::_('Multiple Add') . ' ]</small></small>');
     JToolBarHelper::save();
     JToolBarHelper::cancel();
     JToolBarHelper::help('screen.phocagallery', true);
     $phocagallery->published = 1;
     $phocagallery->order = 0;
     $phocagallery->catid = JRequest::getVar('catid', 0, 'post', 'int');
     $phocagallery->id = 0;
     // build the html select list for ordering
     $query = 'SELECT ordering AS value, title AS text' . ' FROM #__phocagallery' . ' WHERE catid = ' . (int) $phocagallery->catid . ' ORDER BY ordering';
     $lists['ordering'] = JHTML::_('list.specificordering', $phocagallery, $phocagallery->id, $query, false);
     //------------------------------------------------------------------------
     //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);
     $phocagallerys = $db->loadObjectList();
     $tree = array();
     $text = '';
     $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);
     $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, 0);
     array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- ' . JText::_('Select Category') . ' -', 'value', 'text'));
     //list categories
     $lists['catid'] = JHTML::_('select.genericlist', $phocagallerys_tree_array, 'catid', '', 'value', 'text', $phocagallery->catid);
     //-----------------------------------------------------------------------
     // build the html select list
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $phocagallery->published);
     //clean gallery data
     jimport('joomla.filter.output');
     JFilterOutput::objectHTMLSafe($phocagallery, ENT_QUOTES, 'description');
     $this->assignRef('lists', $lists);
     $this->assignRef('phocagallery', $phocagallery);
     $this->assignRef('button', $button);
     $this->assignRef('request_url', $uri->toString());
     //--------------------------------------------------------------------------------------------------------
     /*image manager*/
     JResponse::allowCache(false);
     // Do not allow cache
     $path = PhocaGalleryHelper::getPathSet();
     // Upload Form ------------------------------------
     JHTML::_('behavior.mootools');
     //$document->addScript('components/com_phocagallery/assets/upload/mediamanager.js');
     $document->addStyleSheet('components/com_phocagallery/assets/upload/mediamanager.css');
     // Set FTP form
     $ftp = !JClientHelper::hasCredentials('ftp');
     // Set flash uploader if ftp password and login exists (will be not problems)
     $state = $this->get('state');
     $refreshSite = 'index.php?option=com_phocagallery&view=phocagallerym&layout=form&hidemainmenu=1&folder=' . $state->folder;
     if (!$ftp) {
         if ($params->get('enable_flash', 1)) {
             PhocaGalleryHelperUpload::uploader('file-upload', array('onAllComplete' => 'function(){ window.location.href="' . $refreshSite . '"; }'));
         }
     }
     // PARAMS - Upload size
     $upload_maxsize = 3000000;
     if ($params->get('upload_maxsize') != '') {
         $upload_maxsize = $params->get('upload_maxsize');
     }
     // END Upload Form ------------------------------------
     $this->assignRef('session', JFactory::getSession());
     $this->assignRef('uploadmaxsize', $upload_maxsize);
     $this->assign('require_ftp', $ftp);
     $this->assignRef('path_orig_rel', $path['orig_rel_ds']);
     $this->assignRef('images', $this->get('images'));
     $this->assignRef('folders', $this->get('folders'));
     $this->assignRef('state', $this->get('state'));
     parent::display($tpl);
     echo JHTML::_('behavior.keepalive');
 }
Beispiel #6
0
 function _displayForm($tpl)
 {
     global $mainframe, $option;
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     $user =& JFactory::getUser();
     $model =& $this->getModel();
     $editor =& JFactory::getEditor();
     //Data from model
     $phocagallery =& $this->get('Data');
     JHTML::stylesheet('phocagallery.css', 'administrator/components/com_phocagallery/assets/');
     //Image button
     $link = 'index.php?option=com_phocagallery&amp;view=phocagalleryi&amp;tmpl=component';
     JHTML::_('behavior.modal', 'a.modal-button');
     $button = new JObject();
     $button->set('modal', true);
     $button->set('link', $link);
     $button->set('text', JText::_('Image'));
     $button->set('name', 'image');
     $button->set('modalname', 'modal-button');
     $button->set('options', "{handler: 'iframe', size: {x: 620, y: 400}}");
     $lists = array();
     $isNew = $phocagallery->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('Phoca gallery'), $phocagallery->title);
         $mainframe->redirect('index.php?option=' . $option, $msg);
     }
     // Set toolbar items for the page
     $text = $isNew ? JText::_('New') : JText::_('Edit');
     JToolBarHelper::title(JText::_('Phoca Gallery Image') . ': <small><small>[ ' . $text . ' ]</small></small>', 'gallery');
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     JToolBarHelper::help('screen.phocagallery', true);
     // Edit or Create?
     if (!$isNew) {
         $model->checkout($user->get('id'));
     } else {
         // initialise new record
         $phocagallery->published = 1;
         $phocagallery->order = 0;
         $phocagallery->catid = JRequest::getVar('catid', 0, 'post', 'int');
     }
     // build the html select list for ordering
     $query = 'SELECT ordering AS value, title AS text' . ' FROM #__phocagallery' . ' WHERE catid = ' . (int) $phocagallery->catid . ' ORDER BY ordering';
     $lists['ordering'] = JHTML::_('list.specificordering', $phocagallery, $phocagallery->id, $query, false);
     //------------------------------------------------------------------------
     //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);
     $phocagallerys = $db->loadObjectList();
     $tree = array();
     $text = '';
     $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);
     $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, 0);
     array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- ' . JText::_('Select Category') . ' -', 'value', 'text'));
     //list categories
     $lists['catid'] = JHTML::_('select.genericlist', $phocagallerys_tree_array, 'catid', '', 'value', 'text', $phocagallery->catid);
     //-----------------------------------------------------------------------
     // build the html select list
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $phocagallery->published);
     // Params
     $videoCode = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'videocode');
     $vmProductId = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'vmproductid');
     //clean gallery data
     jimport('joomla.filter.output');
     JFilterOutput::objectHTMLSafe($phocagallery, ENT_QUOTES, 'description');
     $this->assignRef('editor', $editor);
     $this->assignRef('vmproductid', $vmProductId[0]);
     $this->assignRef('videocode', $videoCode[0]);
     $this->assignRef('lists', $lists);
     $this->assignRef('phocagallery', $phocagallery);
     $this->assignRef('button', $button);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
Beispiel #7
0
 function display($tpl = null)
 {
     global $mainframe;
     $uri =& JFactory::getURI();
     $document =& JFactory::getDocument();
     $db =& JFactory::getDBO();
     JHTML::stylesheet('phocagallery.css', 'administrator/components/com_phocagallery/assets/');
     $document->addCustomTag("<!--[if IE]>\n<link rel=\"stylesheet\" href=\"../administrator/components/com_phocagallery/assets/phocagalleryieall.css\" type=\"text/css\" />\n<![endif]-->");
     $link = 'index.php?option=com_phocagallery&amp;view=phocagalleryd&amp;tmpl=component';
     JHTML::_('behavior.modal', 'a.modal-button');
     // Get width and height from default settings
     $params = JComponentHelper::getParams('com_phocagallery');
     $admin_modal_box_width = 680;
     $admin_modal_box_height = 520;
     if ($params->get('admin_modal_box_width') != '') {
         $admin_modal_box_width = $params->get('admin_modal_box_width');
     }
     if ($params->get('admin_modal_box_height') != '') {
         $admin_modal_box_height = $params->get('admin_modal_box_height');
     }
     $button = new JObject();
     $button->set('modal', true);
     $button->set('link', $link);
     $button->set('text', JText::_('Image'));
     $button->set('name', 'image');
     $button->set('modalname', 'modal-button');
     $button->set('options', "{handler: 'iframe', size: {x: " . $admin_modal_box_width . ", y: " . $admin_modal_box_height . "}}");
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('Phoca Gallery Images'), 'gallery');
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::deleteList(JText::_('WARNWANTDELLISTEDITEMS'), 'remove', 'delete');
     JToolBarHelper::editListX();
     JToolBarHelper::addNewX();
     JToolBarHelper::customX('Multiple', 'multiple.png', '', JText::_('Multiple Add'), false);
     JToolBarHelper::preferences('com_phocagallery', '460');
     JToolBarHelper::help('screen.phocagallery', true);
     //Filter
     $context = 'com_phocagallery.phocagallery.list.';
     $filter_state = $mainframe->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'word');
     $filter_catid = $mainframe->getUserStateFromRequest($context . 'filter_catid', 'filter_catid', 0, 'int');
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'a.ordering', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     // Get data from the model
     $items =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     // 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' . ' ORDER BY a.ordering';
     $db->setQuery($query);
     $phocagallerys = $db->loadObjectList();
     $tree = array();
     $text = '';
     $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);
     $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, 0);
     array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- ' . JText::_('Select Category') . ' -', 'value', 'text'));
     //list categories
     $lists['catid'] = JHTML::_('select.genericlist', $phocagallerys_tree_array, '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('button', $button);
     $this->assignRef('user', JFactory::getUser());
     $this->assignRef('lists', $lists);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
Beispiel #8
0
 function _displayForm($tpl)
 {
     global $mainframe, $option;
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     $user =& JFactory::getUser();
     $model =& $this->getModel();
     $editor =& JFactory::getEditor();
     //Data from model
     $phocagallery =& $this->get('Data');
     JHTML::stylesheet('phocagallery.css', 'administrator/components/com_phocagallery/assets/');
     //Image button
     $link = 'index.php?option=com_phocagallery&amp;view=phocagalleryf&amp;tmpl=component';
     JHTML::_('behavior.modal', 'a.modal-button');
     $button = new JObject();
     $button->set('modal', true);
     $button->set('link', $link);
     $button->set('text', JText::_('Folder'));
     $button->set('name', 'image');
     $button->set('modalname', 'modal-button');
     $button->set('options', "{handler: 'iframe', size: {x: 620, y: 400}}");
     $lists = array();
     $isNew = $phocagallery->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('Phoca Gallery Categories'), $phocagallery->title);
         $mainframe->redirect('index.php?option=' . $option, $msg);
     }
     // Set toolbar items for the page
     $text = $isNew ? JText::_('New') : JText::_('Edit');
     JToolBarHelper::title(JText::_('Phoca Gallery Category') . ': <small><small>[ ' . $text . ' ]</small></small>', 'category');
     JToolBarHelper::save();
     JToolBarHelper::apply();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     JToolBarHelper::help('screen.phocagallery', true);
     // Edit or Create?
     if (!$isNew) {
         $model->checkout($user->get('id'));
     } else {
         // initialise new record
         $phocagallery->published = 1;
         $phocagallery->order = 0;
         $phocagallery->access = 0;
     }
     // build the html select list for ordering
     $query = 'SELECT ordering AS value, title AS text' . ' FROM #__phocagallery_categories' . ' ORDER BY ordering';
     $lists['ordering'] = JHTML::_('list.specificordering', $phocagallery, $phocagallery->id, $query, false);
     // build the html select list
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $phocagallery->published);
     $active = $phocagallery->image_position ? $phocagallery->image_position : 'left';
     $lists['image_position'] = JHTML::_('list.positions', 'image_position', $active, NULL, 0, 0);
     // Imagelist
     $lists['image'] = JHTML::_('list.images', 'image', $phocagallery->image);
     // build the html select list for the group access
     $lists['access'] = JHTML::_('list.accesslevel', $phocagallery);
     // All selected users
     // Get all users id from params string
     $accessActive = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'accessuserid');
     $uploadActive = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'uploaduserid');
     $deleteActive = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'deleteuserid');
     $userFolder = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'userfolder');
     $longitude = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'longitude');
     $latitude = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'latitude');
     $zoom = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'zoom');
     $geotitle = PhocaGalleryHelper::getParamsArray($phocagallery->params, 'geotitle');
     // Create a multiple selectbox
     $lists['accessusers'] = PhocaGalleryHelper::usersList('accessuserid[]', $accessActive, 1, NULL, 'name', 0);
     $lists['uploadusers'] = PhocaGalleryHelper::usersList('uploaduserid[]', $uploadActive, 1, NULL, 'name', 0);
     $lists['deleteusers'] = PhocaGalleryHelper::usersList('deleteuserid[]', $deleteActive, 1, NULL, 'name', 0);
     $lists['author'] = PhocaGalleryHelper::usersListAuthor('authorid', $phocagallery->userid, 1, NULL, 'name', 0);
     //------------------------------------------------------------------------
     //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);
     $phocagallerys = $db->loadObjectList();
     $tree = array();
     $text = '';
     $tree = PhocaGalleryHelper::CategoryTree($phocagallerys, $tree, 0, $text);
     $phocagallerys_tree_array = PhocaGalleryHelper::CategoryTreeCreating($phocagallerys, $tree, $phocagallery->id);
     array_unshift($phocagallerys_tree_array, JHTML::_('select.option', '0', '- ' . JText::_('Select Parent Category') . ' -', 'value', 'text'));
     //list categories
     $lists['parentid'] = JHTML::_('select.genericlist', $phocagallerys_tree_array, 'parentid', '', 'value', 'text', $phocagallery->parent_id);
     //-----------------------------------------------------------------------
     //clean gallery data
     jimport('joomla.filter.output');
     JFilterOutput::objectHTMLSafe($phocagallery, ENT_QUOTES, 'description');
     //Params
     #$file 	= JPATH_COMPONENT.DS.'models'.DS.'phocagallery.xml';
     #$params = new JParameter( $phocagallery->params, $file );
     //Longitude Latitude
     if (!isset($longitude[0]) || isset($longitude[0]) && ($longitude[0] == '' || $longitude[0] == 0)) {
         $longitude[0] = '';
         $longitudeLink = '14.429919719696045';
     } else {
         $longitudeLink = $longitude[0];
     }
     if (!isset($latitude[0]) || isset($latitude[0]) && ($latitude[0] == '' || $latitude[0] == 0)) {
         $latitude[0] = '';
         $latitudeLink = '50.079623358200884';
     } else {
         $latitudeLink = $latitude[0];
     }
     if (!isset($zoom[0]) || isset($zoom[0]) && ($zoom[0] == '' || $zoom[0] == 0)) {
         $zoom[0] = 2;
     }
     if (!isset($geotitle[0]) || isset($geotitle[0]) && $geotitle[0] == '') {
         $geotitle[0] = '';
     }
     //Get button
     $linkg = 'index.php?option=com_phocagallery&amp;view=phocagalleryg&amp;tmpl=component&amp;lat=' . $latitudeLink . '&amp;lng=' . $longitudeLink . '&amp;zoom=' . $zoom[0];
     JHTML::_('behavior.modal', 'a.modal-button');
     $buttong = new JObject();
     $buttong->set('modal', true);
     $buttong->set('link', $linkg);
     $buttong->set('text', JText::_('coordinates'));
     $buttong->set('name', 'image');
     $buttong->set('modalname', 'modal-button');
     $buttong->set('options', "{handler: 'iframe', size: {x: 640, y: 560}}");
     $this->assignRef('userfolder', $userFolder[0]);
     $this->assignRef('editor', $editor);
     $this->assignRef('lists', $lists);
     $this->assignRef('phocagallery', $phocagallery);
     $this->assignRef('button', $button);
     $this->assignRef('buttong', $buttong);
     $this->assignRef('longitude', $longitude[0]);
     $this->assignRef('latitude', $latitude[0]);
     $this->assignRef('zoom', $zoom[0]);
     $this->assignRef('geotitle', $geotitle[0]);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }