/** * Display the Message templates view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ function display($tpl = null) { // Get data from the model $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Add publishers helper file require_once JPATH_COMPONENT . '/helpers/publishers.php'; // Add sidebar PublishersHelper::addSubmenu('messagetemplates'); // Load message type model $model = JModelLegacy::getInstance('messagetype', 'IsbnregistryModel'); // Load message types $types = $model->getMessageTypesHash(); // Pass $types to the layout $this->assignRef('types', $types); // Set the toolbar $this->addToolBar(); // Render the sidebar $this->sidebar = JHtmlSidebar::render(); // Display the template parent::display($tpl); }
/** * Display the Message types view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ function display($tpl = null) { // Get data from the model $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Add publishers helper file require_once JPATH_COMPONENT . '/helpers/publishers.php'; // Add sidebar PublishersHelper::addSubmenu('groupmessages'); // Set the toolbar $this->addToolBar(); // Render the sidebar $this->sidebar = JHtmlSidebar::render(); // Display the template parent::display($tpl); }
/** * Display the Publications view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ function display($tpl = null) { // Get data from the model $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Get filter status $filterStatus = $this->state->get('filter.status'); // Add publishers helper file require_once JPATH_COMPONENT . '/helpers/publishers.php'; // Add sidebar if ($filterStatus == 1) { PublishersHelper::addSubmenu('publications_received'); } else { if ($filterStatus == 2) { PublishersHelper::addSubmenu('publications_on_process'); } else { if ($filterStatus == 4) { PublishersHelper::addSubmenu('publications_no_identifier_granted'); } else { PublishersHelper::addSubmenu('publications_processed'); } } } // Set the toolbar $this->addToolBar(); // Render the sidebar $this->sidebar = JHtmlSidebar::render(); // Display the template parent::display($tpl); }
/** * Display the Publishers view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ function display($tpl = null) { // Get data from the model $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Get filter no identifier $filterNoIdentifier = $this->state->get('filter.no_identifier'); // Add publishers helper file require_once JPATH_COMPONENT . '/helpers/publishers.php'; // Add sidebar if ($filterNoIdentifier == 1) { PublishersHelper::addSubmenu('publishers_applications'); // Set an empty array as variable value $this->ismn_publisher_ids = array(); } else { PublishersHelper::addSubmenu('publishers_registry'); // Load publisher ismn range model $model = JModelLegacy::getInstance('publisherismnrange', 'IsbnregistryModel'); // Load message types $ids = $model->getIsmnPublisherIds(); // Pass results to the layout $this->ismn_publisher_ids = $ids; } // Set the toolbar $this->addToolBar(); // Render the sidebar $this->sidebar = JHtmlSidebar::render(); // Display the template parent::display($tpl); }
/** * Creates an array for generating a CSV file. Adds required headers and * publications data. * @param array $publications publications to be added to the CSV file * @param boolean $ismn are these ISMN publications * @return array headers and publications array */ public static function toCSVArray($publications, $ismn = false) { // Array for results $list = array(); // Add publications helper file require_once JPATH_COMPONENT . '/helpers/publishers.php'; // CSV headers $headers = PublishersHelper::getPIIDHeaders($ismn); // Add headers array_push($list, $headers); // Loop through the publications foreach ($publications as $publication) { if (!empty($publication->publication_identifier_print)) { $json = json_decode($publication->publication_identifier_print); if (!empty($json)) { foreach ($json as $identifier => $type) { array_push($list, self::publicationToArray($publication, $identifier)); } } } if (!empty($publication->publication_identifier_electronical)) { $json = json_decode($publication->publication_identifier_electronical); if (!empty($json)) { foreach ($json as $identifier => $type) { array_push($list, self::publicationToArray($publication, $identifier)); } } } } // Return results return $list; }
private function getISMNPublishersStatsUnique($begin, $end) { // Get publisher model $publisherModel = JModelLegacy::getInstance('publisher', 'IsbnregistryModel'); // Get list of publishers $list = $publisherModel->getPublishersWithFirstIdentifier($begin, $end, 'ismn'); // Add publications helper file require_once JPATH_COMPONENT . '/helpers/publishers.php'; // Convert list to CSV array return PublishersHelper::toCSVArray($list, true); }