/** * Retrieve an element's options (typically called via AJAX) * * @return void */ public function elementTask() { $ctrl = Request::getVar('ctrl', 'fields'); $option = new stdClass(); $option->label = ''; $option->value = ''; $field = new stdClass(); $field->label = Request::getVar('name', 0); $field->element = ''; $field->description = ''; $field->text = $field->label; $field->name = $field->label; $field->default = ''; $field->type = Request::getVar('type', ''); $field->options = array($option, $option); include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'models' . DS . 'elements.php'; $elements = new \Components\Publications\Models\Elements(); echo $elements->getElementOptions($field->name, $field, $ctrl); }
Toolbar::cancel(); $database = App::get('db'); // Get pub category $rt = $this->model->category(); // Parse data $data = array(); preg_match_all("#<nb:(.*?)>(.*?)</nb:(.*?)>#s", $this->model->get('metadata'), $matches, PREG_SET_ORDER); if (count($matches) > 0) { foreach ($matches as $match) { $data[$match[1]] = $match[2]; } } $customFields = $rt->customFields && $rt->customFields != '{"fields":[]}' ? $rt->customFields : '{"fields":[{"default":"","name":"citations","label":"Citations","type":"textarea","required":"0"}]}'; $customFields = $this->model->_curationModel->getMetaSchema(); include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'models' . DS . 'elements.php'; $elements = new \Components\Publications\Models\Elements($data, $customFields); $fields = $elements->render(); $schema = $elements->getSchema(); $canedit = 1; $now = Date::toSql(); $status = $this->model->getStatusName(); $rating = $this->model->get('master_rating') == 9.9 ? 0.0 : $this->model->get('master_rating'); $params = $this->model->params; // Available panels and default config $typeParams = $this->model->masterType()->_params; $panels = array('authors' => $typeParams->get('show_authors', 2), 'audience' => $typeParams->get('show_audience', 0), 'gallery' => $typeParams->get('show_gallery', 1), 'tags' => $typeParams->get('show_tags', 1), 'license' => $typeParams->get('show_license', 2), 'notes' => $typeParams->get('show_notes', 1), 'metadata' => $typeParams->get('show_metadata', 1), 'submitter' => $typeParams->get('show_submitter', 0)); ?> <script type="text/javascript"> function submitbutton(pressbutton) {
$abstract = stripslashes($this->publication->abstract); $description = $this->publication->describe('parsed'); $this->publication->authors(); $this->publication->attachments(); $this->publication->license(); $data = array(); preg_match_all("#<nb:(.*?)>(.*?)</nb:(.*?)>#s", $this->publication->metadata, $matches, PREG_SET_ORDER); if (count($matches) > 0) { foreach ($matches as $match) { $data[$match[1]] = $match[2]; } } $category = $this->publication->_category; $customFields = $this->publication->_curationModel->getMetaSchema(); include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'models' . DS . 'elements.php'; $metaElements = new \Components\Publications\Models\Elements($data, $customFields); $schema = $metaElements->getSchema(); ?> <div class="pubabout"> <?php // Show gallery images $modelHandler = new \Components\Publications\Models\Handlers($this->database); // Load image handler if ($handler = $modelHandler->ini('imageviewer')) { echo $handler->showImageBand($this->publication); } ?> <h4><?php echo Lang::txt('COM_PUBLICATIONS_ABSTRACT'); ?>
//($this->row->id) ? '5' : '4'; ?> "> <button id="add-custom-field" href="#addRow"> <span><?php echo Lang::txt('COM_PUBLICATIONS_ADD_ROW'); ?> </span> </button> </td> </tr> </tfoot> <tbody id="field-items"> <?php include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'models' . DS . 'elements.php'; $elements = new \Components\Publications\Models\Elements('', $this->row->customFields); $schema = $elements->getSchema(); if (!is_object($schema)) { $schema = new stdClass(); $schema->fields = array(); } if (count($schema->fields) <= 0) { $fs = explode(',', $this->config->get('tagsothr', 'bio,credits,citations,sponsoredby,references,publications')); foreach ($fs as $f) { $f = trim($f); $element = new stdClass(); $element->name = preg_replace('/[^a-zA-Z0-9]/', '', strtolower($f)); $element->label = ucfirst($f); $element->type = 'text'; $element->required = ''; $element->value = '';