?
Path : /home/admin/public_html/old/administrator/components/com_xijc/views/blacklist/ |
Current File : /home/admin/public_html/old/administrator/components/com_xijc/views/blacklist/view.html.php |
<?php // no direct access defined('_JEXEC') or die('Restricted access'); // Import Joomla! libraries jimport( 'joomla.application.component.view'); class XiJCViewBlacklist extends JView { function display($tpl = null) { $bModel = XiJCFactory::getModel( 'blacklist' ); $blacklist =& $bModel->getBlacklist(); $pagination =& $bModel->getPagination(); $comname = array(); $comeditable = array(); //get component name from option if(!empty($blacklist)){ foreach($blacklist as $b) { if(array_key_exists($b->option,$comname)) continue; $filter['option'] = $b->option; $obj = XiJCFactory::getComponents($filter); if(empty($obj)) { $comname[$b->option] = JText::_('THIS COMPONENT HAS BEEN UNINSTALLED'); $comeditable[$b->option] = 0; continue; } $comname[$b->option] = $obj[0]->name; $comeditable[$b->option] = 1; } } // Load tooltips JHTML::_('behavior.tooltip', '.hasTip'); jimport('joomla.html.pane'); $pane =& JPane::getInstance('sliders'); $this->setToolbar(); $this->assignRef( 'pane' , $pane ); $this->assign( 'blacklist' , $blacklist ); $this->assign( 'comname' , $comname ); $this->assign( 'comeditable' , $comeditable ); $this->assignRef( 'pagination' , $pagination ); parent::display( $tpl ); } function edit($id,$tpl = null) { JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables'); $row =& JTable::getInstance( 'blacklist' , 'XiJCTable' ); $row->load($id); $config = new JParameter($row->params); $paramarray = $config->toArray(); $mModel = XiJCFactory::getModel('manager'); $filter = array(); $filter['parent'] = 0; $allcomponents = XiJCFactory::getComponents($filter); $this->assign( 'id' , $id ); $this->assign( 'row' , $row ); $this->assign( 'components' , $allcomponents ); $this->assign( 'paramarray' , $paramarray ); // Set the titlebar text JToolBarHelper::title( JText::_( 'EDIT BLACKLIST' ), 'blacklist' ); // Add the necessary buttons JToolBarHelper::back('Home' , 'index.php?option=com_xijc&view=blacklist'); JToolBarHelper::divider(); JToolBarHelper::save('save','SAVE'); JToolBarHelper::cancel( 'cancel', 'CLOSE' ); parent::display($tpl); } function setToolBar() { // Set the titlebar text JToolBarHelper::title( JText::_( 'BLACKLIST' ), 'blacklist' ); // Add the necessary buttons JToolBarHelper::back('Home' , 'index.php?option=com_xijc'); JToolBarHelper::divider(); JToolBarHelper::trash('remove', 'DELETE' ); JToolBarHelper::addNew('edit', 'ADD' ); JToolBarHelper::divider(); JToolBarHelper::publishList('publish', 'ENABLE' ); JToolBarHelper::unpublishList('unpublish', 'DISABLE' ); } }