示例#1
0
 public function build()
 {
     parent::build();
     parent::addStylesheetToHead(URL . '/extensions/importcsv/assets/importcsv.css');
     // parent::addStylesheetToHead(URL . '/symphony/assets/forms.css');
     parent::addScriptToHead(URL . '/extensions/importcsv/assets/importcsv.js', 70);
     $this->setTitle('Symphony - Import / export CSV');
     $this->Context->appendChild(new XMLElement('h2', __('Import / Export CSV')));
 }
 public function build($context)
 {
     $this->_action = isset($context[0]) ? $context[0] : false;
     if ($this->_action == 'edit' && isset($context[1]) && is_numeric($context[1])) {
         // Load the data:
         $this->_id_role = $context[1];
         $this->_data = $this->_driver->getData($this->_id_role);
     }
     if (isset($_POST['save'])) {
         // Save:
         $this->_id_role = $this->_driver->saveData($_POST);
         if ($this->_id_role != false) {
             $this->_data = $this->_driver->getData($this->_id_role);
             $this->pageAlert(__('Role successfully created/updated.'), Alert::SUCCESS);
         } else {
             $this->pageAlert(__('Role not saved: Please enter a name.'), Alert::ERROR);
         }
     }
     parent::addStylesheetToHead(URL . '/extensions/author_roles/assets/author_roles.css', 'screen', 70);
     parent::addScriptToHead(URL . '/extensions/author_roles/assets/author_roles.js', 71);
     parent::build($context);
 }