コード例 #1
0
 function __construct($config = null)
 {
     parent::__construct($config);
     $this->jevlayout = "default";
     $this->addHelperPath(realpath(dirname(__FILE__) . "/../helpers"));
     $this->addHelperPath(JPATH_BASE . DS . 'templates' . DS . JFactory::getApplication()->getTemplate() . DS . 'html' . DS . JEV_COM_COMPONENT . DS . "helpers");
     // attach data model
     $this->datamodel = new JEventsDataModel();
     $this->datamodel->setupComponentCatids();
     $reg =& JevRegistry::getInstance("jevents");
     $reg->setReference("jevents.datamodel", $this->datamodel);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: madcsaba/li-de
 function export($tpl = null)
 {
     parent::displaytemplate($tpl);
 }
コード例 #3
0
 function edit($tpl = null)
 {
     $this->_hideSubmenu();
     include_once JPATH_ADMINISTRATOR . DS . "includes" . DS . "toolbar.php";
     // TODO find the active admin template
     if (!JVersion::isCompatible("1.6.0")) {
         JEVHelper::stylesheet("template.css", JURI::root() . "administrator/templates/khepri/css/");
     }
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     if (JVersion::isCompatible("1.6.0")) {
         JEVHelper::stylesheet('eventsadmin16.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
     } else {
         JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
     }
     JEVHelper::script('editdefaults.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('JEV_LAYOUT_DEFAULT_EDIT'));
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('JEV_LAYOUT_DEFAULT_EDIT'), 'jevents');
     JToolBarHelper::save("defaults.save");
     JToolBarHelper::cancel("defaults.cancel");
     JSubMenuHelper::addEntry(JText::_('DEFAULTS'), 'index.php?option=' . JEV_COM_COMPONENT, true);
     JHTML::_('behavior.tooltip');
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     // Get data from the model
     $model =& $this->getModel();
     $item =& $this->get('Data');
     if (strpos($item->name, "com_") === 0) {
         $parts = explode(".", $item->name);
         // special numbered case e.g. managed people
         if (count($parts) == 4) {
             $iname = str_replace(".{$parts['2']}.", ".", $item->name);
         } else {
             $iname = $item->name;
         }
         $this->_addPath('template', JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl");
         if ($item->value == "" && file_exists(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html")) {
             $item->value = file_get_contents(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html");
         }
     }
     $this->assignRef('item', $item);
     parent::displaytemplate($tpl);
 }
コード例 #4
0
ファイル: view.html.php プロジェクト: madcsaba/li-de
 function edit($tpl = null)
 {
     include_once JPATH_ADMINISTRATOR . '/' . "includes" . '/' . "toolbar.php";
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     JEVHelper::script('editdefaults.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('JEV_LAYOUT_DEFAULT_EDIT'));
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $requiredfields = $params->get("com_jeveditionrequiredfields", "");
     if (!empty($requiredfields)) {
         $requiredfields = "'" . implode("','", $requiredfields) . "'";
     }
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('JEV_LAYOUT_DEFAULT_EDIT'), 'jevents');
     JToolBarHelper::apply("defaults.apply");
     JToolBarHelper::save("defaults.save");
     JToolBarHelper::cancel("defaults.cancel");
     JEventsHelper::addSubmenu();
     JHTML::_('behavior.tooltip');
     $db = JFactory::getDBO();
     $uri = JFactory::getURI();
     // Get data from the model
     $model = $this->getModel();
     $item = $this->get('Data');
     if (strpos($item->name, "com_") === 0) {
         $parts = explode(".", $item->name);
         // special numbered case e.g. managed people
         if (count($parts) == 4) {
             $iname = str_replace(".{$parts['2']}.", ".", $item->name);
         } else {
             $iname = $item->name;
         }
         $this->_addPath('template', JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl");
         if ($item->value == "" && file_exists(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html")) {
             $item->value = file_get_contents(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html");
         }
     }
     $this->assignRef('item', $item);
     $this->assignRef('requiredfields', $requiredfields);
     parent::displaytemplate($tpl);
 }