Пример #1
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //site document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . "/src/Cobalt/media/js/cobalt-admin.js");
     //gather information for view
     $model = new CategoriesModel();
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     if ($layout && $layout == 'edit') {
         ToolbarHelper::cancel('cancel');
         ToolbarHelper::save('save');
         $this->category = $model->getCategory();
     } else {
         //buttons
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'remove');
         //view references
         $categories = $model->getCategories();
         $this->categories = $categories;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $state->get('Categories.filter_order');
         $this->listDirn = $state->get('Categories.filter_order_Dir');
     }
     //display
     return parent::render();
 }
Пример #2
0
 public function render()
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //load model
     $layout = $this->getLayout();
     $model = new FormWizardModel();
     $model->set("_layout", $layout);
     //document
     $document = JFactory::getDocument();
     // Create the toolbar object
     $this->toolbar = new Toolbar();
     //add toolbar buttons to manage users
     if ($layout == 'default') {
         //buttons
         $this->toolbar->addNew();
         $this->toolbar->addDeleteRow();
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'remove');
         // Initialise variables.
         $this->state = $model->getState();
         $this->forms = $model->getForms();
         $this->listOrder = $this->state->get('Formwizard.filter_order');
         $this->listDirn = $this->state->get('Formwizard.filter_order_Dir');
     } elseif ($layout == 'edit') {
         //buttons
         $this->toolbar->save();
         $this->toolbar->cancel();
         //form
         $form_id = $model->getTempFormId();
         $this->form_id = $form_id;
         $this->form = $model->getForm();
         //form types
         $this->form_types = DropdownHelper::getFormTypes($this->form['type']);
         $fields = array('lead' => DropdownHelper::getFormFields('people'), 'contact' => DropdownHelper::getFormFields('people'), 'deal' => DropdownHelper::getFormFields('deal'), 'company' => DropdownHelper::getFormFields('company'));
         $this->fields = $fields;
         $document->addScriptDeclaration('var fields=' . json_encode($fields));
         //get joomla users to add
         $model = new UsersModel();
         $user_list = $model->getUsers();
         $document->addScriptDeclaration('var user_list=' . json_encode($user_list) . ';');
     }
     //javascripts
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/jquery.base64.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/formwizard.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //display
     return parent::render();
 }
Пример #3
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/custom_manager.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //model
     $model = new DealCustomModel();
     //gather information for view
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     $this->pagination = $model->getPagination();
     if ($layout && $layout == 'edit') {
         //toolbar
         ToolbarHelper::cancel('cancel');
         ToolbarHelper::save('save');
         //assign view info
         $this->custom_types = DropdownHelper::getCustomTypes('deal');
         $this->custom = $model->getItem();
         if ($this->custom['type'] != null) {
             $document->addScriptDeclaration('var type = "' . $this->custom['type'] . '";');
         }
     } else {
         //buttons
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'delete');
         //assign view info
         $custom = $model->getCustom();
         $this->custom_fields = $custom;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $this->state->get('Dealcustom.filter_order');
         $this->listDirn = $this->state->get('Dealcustom.filter_order_Dir');
         $this->saveOrder = $this->listOrder == 'c.ordering';
     }
     //display
     return parent::render();
 }
Пример #4
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //gather information for view
     $model = new SourcesModel();
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     $this->pagination = $model->getPagination();
     if ($layout && $layout == 'edit') {
         //toolbar
         ToolbarHelper::cancel('cancel');
         ToolbarHelper::save('save');
         //information for view
         $this->source_types = DropdownHelper::getSources();
         $this->source = $model->getSource();
     } else {
         //buttons
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'delete');
         //get sources
         $sources = $model->getSources();
         $this->sources = $sources;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $this->state->get('Sources.filter_order');
         $this->listDirn = $this->state->get('Sources.filter_order_Dir');
         $this->saveOrder = $this->listOrder == 's.ordering';
     }
     //display
     return parent::render();
 }