/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'notes', 'label' => 'Notes', 'title' => 'Version Release Notes', 'draftHeading' => 'Add version release notes', 'draftTagline' => '', 'about' => '', 'adminTips' => '', 'elements' => array(10 => array('name' => 'metadata', 'type' => 'metadata', 'label' => 'Release Notes', 'about' => '<p>Version release notes usually include statements about version limitations and/or differences with previous versions, as well as any miscellaneous information that couldn\'t fit elsewhere.</p>', 'adminTips' => '', 'params' => array('required' => 0, 'aliasmap' => 'release_notes', 'field' => 'release_notes', 'input' => 'editor', 'placeholder' => 'Type version release notes', 'default' => '', 'maxlength' => '3000', 'cols' => '50', 'rows' => '6'))), 'params' => array('required' => 0, 'published_editing' => 0, 'collapse_elements' => 1)); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'extras', 'label' => 'Extras', 'title' => 'Publication Gallery and Supporting Docs', 'draftHeading' => 'Let\'s jazz up the publication page', 'draftTagline' => 'Add images/supporting docs:', 'about' => '', 'adminTips' => '', 'elements' => array(2 => array('name' => 'dataselector', 'type' => 'attachment', 'label' => 'Image Gallery', 'about' => '<p>Select image file(s) from the project repository</p>', 'aboutProv' => '<p>Attach image file(s) for publication gallery</p>', 'adminTips' => '', 'params' => array('type' => 'file', 'title' => '', 'required' => 0, 'min' => 0, 'max' => 50, 'role' => 3, 'typeParams' => array('allowed_ext' => array('gif', 'jpg', 'jpeg', 'png', 'bmp'), 'required_ext' => array(), 'handler' => 'imageviewer', 'handlers' => NULL, 'directory' => 'gallery', 'reuse' => 1, 'dirHierarchy' => 0, 'multiZip' => 0))), 3 => array('name' => 'dataselector', 'type' => 'attachment', 'label' => 'Supporting Docs', 'about' => '<p>And supporting materials related to publication</p>', 'aboutProv' => '<p>Attach a file or a number of files</p>', 'adminTips' => '', 'params' => array('type' => 'file', 'title' => '', 'required' => 0, 'min' => 0, 'max' => 500, 'role' => 2, 'typeParams' => array('allowed_ext' => array(), 'required_ext' => array(), 'handler' => NULL, 'handlers' => NULL, 'directory' => '', 'reuse' => 1, 'dirHierarchy' => 1, 'multiZip' => 0)))), 'params' => array('required' => 0, 'published_editing' => 1, 'collapse_elements' => 0, 'verify_types' => 1)); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'authors', 'label' => 'Authors', 'title' => 'Publication Authors', 'draftHeading' => 'Who are the authors?', 'draftTagline' => 'Build the author list', 'about' => '<p>Publication authors get selected from your current project team. Anyone you add as an author will also be added to your team as a project collaborator.</p>', 'adminTips' => '', 'elements' => array(), 'params' => array('required' => 1, 'published_editing' => 0, 'submitter' => 1, 'group_owner' => 0)); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * @return array The URL attributes to be used by the application. */ public function parse(&$segments) { $vars = array(); // General project tasks $tasks = array('edit', 'browse', 'intro', 'features', 'auth', 'delete', 'fixownership', 'suspend', 'reinstate', 'process', 'activate'); // Media tasks $mediaTasks = array('deleteimg', 'media', 'thumb', 'doajaxupload'); // Tasks managed by Setup controller $setupTasks = array('setup', 'start', 'edit', 'save', 'verify', 'suggestalias'); if (empty($segments[0])) { return $vars; } // Id? if (is_numeric($segments[0])) { $vars['id'] = $segments[0]; if (empty($segments[1])) { $vars['task'] = 'view'; return $vars; } } // Alias? if (!is_numeric($segments[0])) { if ($segments[0] == 'get') { $vars['controller'] = 'get'; return $vars; } if ($segments[0] == 'reports') { $vars['controller'] = 'reports'; if (!empty($segments[1])) { $vars['task'] = $segments[1]; } return $vars; } elseif (in_array($segments[0], $setupTasks)) { $vars['controller'] = 'setup'; $vars['task'] = $segments[0]; return $vars; } elseif (in_array($segments[0], $tasks)) { $vars['task'] = $segments[0]; if (!empty($segments[1])) { $vars['action'] = $segments[1]; } return $vars; } elseif ($segments[0] == 'media') { $vars['task'] = 'media'; $vars['controller'] = 'media'; if (!empty($segments[1])) { $vars['alias'] = $segments[1]; } if (!empty($segments[2])) { $vars['media'] = $segments[2]; } return $vars; } else { // Project page view $vars['alias'] = $segments[0]; if (empty($segments[1])) { $vars['task'] = 'view'; return $vars; } } } if (!empty($segments[1])) { if ($segments[1] == 'view') { $vars['task'] = $segments[1]; if (!empty($segments[2])) { $vars['active'] = $segments[2]; } return $vars; } elseif (in_array($segments[1], $setupTasks)) { $vars['controller'] = 'setup'; $vars['task'] = $segments[1]; if (!empty($segments[2])) { $vars['active'] = $segments[2]; } if (isset($segments[3])) { $vars['action'] = $segments[3]; } return $vars; } elseif (in_array($segments[1], $tasks)) { $vars['task'] = $segments[1]; return $vars; } elseif (in_array($segments[1], $mediaTasks)) { $vars['controller'] = 'media'; $vars['task'] = $segments[1]; if (!empty($segments[2])) { $vars['media'] = $segments[2]; } return $vars; } else { $vars['active'] = $segments[1]; $vars['task'] = 'view'; // Publications if (!empty($segments[2]) && $vars['active'] == 'publications') { if (is_numeric($segments[2])) { $vars['pid'] = $segments[2]; $blocks = array(); if (is_file(PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'block.php')) { include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'block.php'; $database = \App::get('db'); $b = new \Components\Publications\Tables\Block($database); $blocks = $b->getBlocks('block'); $blocks[] = 'status'; } if (!empty($segments[3]) && in_array($segments[3], $blocks)) { $vars['section'] = $segments[3]; if (!empty($segments[4]) && $segments[4] == 'continue') { $vars['move'] = $segments[4]; if (!empty($segments[5])) { if (is_numeric($segments[5])) { $vars['step'] = $segments[5]; if (!empty($segments[6])) { $vars['action'] = $segments[6]; } } else { $vars['action'] = $segments[5]; } } } elseif (!empty($segments[4])) { if (is_numeric($segments[4])) { $vars['step'] = $segments[4]; if (!empty($segments[5])) { $vars['action'] = $segments[5]; } } else { $vars['action'] = $segments[4]; } } } else { if (!empty($segments[3])) { $vars['action'] = $segments[3]; } } } else { $vars['action'] = $segments[2]; } return $vars; } // Tools if (!empty($segments[2]) && $vars['active'] == 'tools') { // App actions $appActions = array('status', 'history', 'wiki', 'browse', 'edit', 'start', 'save', 'register', 'attach', 'source', 'cancel', 'update', 'message', 'verify', 'addimage'); if (in_array($segments[2], $appActions)) { $vars['action'] = $segments[2]; } else { $vars['tool'] = $segments[2]; $vars['action'] = 'status'; } if (!empty($segments[3]) && in_array($segments[3], $appActions)) { $vars['action'] = $segments[3]; } return $vars; } elseif (!empty($segments[2]) && $vars['active'] == 'notes') { // Wiki actions $wiki_actions = array('media', 'list', 'upload', 'deletefolder', 'deletefile', 'view', 'new', 'edit', 'save', 'cancel', 'delete', 'deleteversion', 'approve', 'rename', 'saverename', 'history', 'compare', 'comments', 'editcomment', 'addcomment', 'savecomment', 'removecomment', 'reportcomment', 'deleterevision', 'pdf'); $remaining = array_slice($segments, 2); $action = array_pop($remaining); $pagename = ''; if (in_array($action, $wiki_actions)) { $vars['action'] = $action; $pagename = array_pop($remaining); } else { $vars['action'] = 'view'; $pagename = $action; } $vars['pagename'] = $pagename; // Collect scope if (isset($vars['alias'])) { if (count($remaining) > 0) { $scope = 'projects' . DS . $vars['alias'] . DS . 'notes'; for ($i = 0; $i < count($remaining); $i++) { $scope .= DS . $remaining[$i]; // inlcude parent page names } if ($vars['action'] == 'new') { $scope .= DS . $pagename; } $vars['scope'] = $scope; } elseif ($vars['action'] == 'new') { $scope = 'projects' . DS . $vars['alias'] . DS . 'notes' . DS . $pagename; $vars['scope'] = $scope; } } return $vars; } // Links if (!empty($segments[2]) && $vars['active'] == 'links') { if (!empty($segments[2]) && is_numeric($segments[2])) { $vars['pid'] = $segments[2]; } if (!empty($segments[3])) { $vars['action'] = $segments[3]; } } // Team if (!empty($segments[2]) && $vars['active'] == 'team') { if (!empty($segments[2]) && is_numeric($segments[2])) { $vars['pid'] = $segments[2]; if (!empty($segments[3])) { $vars['action'] = $segments[3]; } } else { $vars['action'] = $segments[2]; } } elseif (!empty($segments[2]) && !is_numeric($segments[2])) { $vars['action'] = $segments[2]; } } } return $vars; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'license', 'label' => 'License', 'title' => 'Publication License', 'draftHeading' => 'Choose License', 'draftTagline' => 'Define copyright and terms of use:', 'about' => 'It is important that you provide a license for your publication stating your copyright and terms of use of your content.', 'adminTips' => '', 'elements' => array(), 'params' => array('required' => 1, 'published_editing' => 0, 'include' => array(), 'exclude' => array())); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'citations', 'label' => 'Citations', 'title' => 'Citations to integral or companion resources', 'draftHeading' => 'Add citations', 'draftTagline' => 'Cite integral or companion resources', 'about' => '', 'adminTips' => '', 'elements' => array(), 'params' => array('required' => 0, 'published_editing' => 1)); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'review', 'label' => 'Review', 'title' => 'Publication Review', 'draftHeading' => 'Review Publication', 'draftTagline' => 'Here is your publication at a glance:', 'about' => '', 'adminTips' => '', 'elements' => array(), 'params' => array('required' => 1, 'published_editing' => 0)); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'description', 'label' => 'Description', 'title' => 'Publication Description', 'draftHeading' => 'Name and describe your publication', 'draftTagline' => 'Here is what\'s required:', 'about' => '', 'adminTips' => '', 'elements' => array(1 => array('name' => 'metadata', 'type' => 'metadata', 'label' => 'Publication Title', 'about' => '<p>Pick a descriptive yet concise publication title that will quickly tell users about its content.</p>', 'adminTips' => '', 'params' => array('required' => 1, 'aliasmap' => 'title', 'field' => 'title', 'input' => 'text', 'placeholder' => 'Type publication title', 'default' => 'Untitled Draft', 'maxlength' => '255')), 2 => array('name' => 'metadata', 'type' => 'metadata', 'label' => 'Publication Abstract', 'about' => '<p>Provide a short (max 255 characters) abstract for your publication</p>', 'adminTips' => '', 'params' => array('required' => 1, 'aliasmap' => 'abstract', 'field' => 'abstract', 'input' => 'textarea', 'placeholder' => 'Type publication abstract', 'default' => '', 'maxlength' => '255', 'cols' => '50', 'rows' => '3')), 3 => array('name' => 'metadata', 'type' => 'metadata', 'label' => 'Publication Description', 'about' => '<p>Describe your publication in detail</p>', 'adminTips' => '', 'params' => array('required' => 1, 'aliasmap' => 'description', 'field' => 'description', 'input' => 'editor', 'placeholder' => 'Describe publication', 'default' => '', 'maxlength' => '3000', 'cols' => '50', 'rows' => '6'))), 'params' => array('required' => 1, 'published_editing' => 0, 'collapse_elements' => 1)); if ($new == true) { $manifest['label'] = 'Metadata'; $manifest['title'] = 'Publication Metadata'; $manifest['draftHeading'] = 'Provide some metadata'; $manifest['elements'] = array(1 => $this->getElementManifest()); } return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'tags', 'label' => 'Tags', 'title' => 'Publication Tags', 'draftHeading' => 'Add tags', 'draftTagline' => 'Make your publication more discoverable:', 'about' => 'Tags help users find your publication. Before adding your own tags, try finding good matches in existing tag library.', 'adminTips' => '', 'elements' => array(), 'params' => array('required' => 1, 'published_editing' => 0)); return json_decode(json_encode($manifest), FALSE); } return $manifest; }
/** * Get default manifest for the block * * @return void */ public function getManifest($new = false) { // Load config from db $obj = new \Components\Publications\Tables\Block($this->_parent->_db); $manifest = $obj->getManifest($this->_name); // Fall back if (!$manifest) { $manifest = array('name' => 'content', 'label' => 'Content', 'title' => 'Publication Content', 'draftHeading' => 'Let\'s work on publication content', 'draftTagline' => 'Here is what\'s required:', 'about' => '', 'adminTips' => '', 'elements' => array(1 => array('name' => 'dataselector', 'type' => 'attachment', 'label' => 'Primary File(s)', 'about' => '<p>Select a file or a number of files from the project repository</p>', 'aboutProv' => '<p>Attach a file or a number of files to be bundled together</p>', 'adminTips' => '', 'params' => array('type' => 'file', 'title' => '', 'required' => 1, 'min' => 1, 'max' => 500, 'role' => 1, 'typeParams' => array('allowed_ext' => array(), 'required_ext' => array(), 'handler' => NULL, 'handlers' => array(), 'directory' => '', 'reuse' => 0, 'dirHierarchy' => 1, 'multiZip' => 1)))), 'params' => array('required' => 1, 'published_editing' => 0, 'collapse_elements' => 1, 'verify_types' => 1)); if ($new == true) { $manifest['elements'] = array(1 => $this->getElementManifest()); } return json_decode(json_encode($manifest), FALSE); } return $manifest; }