コード例 #1
0
ファイル: default.php プロジェクト: kevinwojo/hubzero-cms
    ?>
				<input type="hidden" name="task" value="submit" />
				<input type="hidden" name="ajax" value="0" />
			<?php 
}
?>
		</fieldset>

		<?php 
if ($this->block == 'license') {
    $task = 'apply';
    // Get selections
    $selections = NULL;
    $selected = NULL;
    $objL = new \Components\Publications\Tables\License($this->database);
    $selected = $objL->getPubLicense($this->publication->get('version_id'));
    $selections = $objL->getBlockLicenses($manifest, $selected);
    if (!$selections) {
        $selections = $objL->getDefaultLicense();
    }
    if (!$selections) {
        echo '<p class="error">' . Lang::txt('PLG_PROJECTS_PUBLICATIONS_SELECTOR_ERROR_NO_SELECTIONS') . '</p>';
    } else {
        ?>
				<p class="requirement" id="req"><?php 
        echo Lang::txt('PLG_PROJECTS_PUBLICATIONS_SELECTOR_REQ_' . strtoupper($this->block));
        ?>
</p>
				<div id="content-selector" class="content-selector">
					<?php 
        // Show selection
コード例 #2
0
ファイル: license.php プロジェクト: mined-gatech/hubzero-cms
 /**
  * Build panel content
  *
  * @return  string  HTML
  */
 public function buildContent($pub = NULL, $viewname = 'edit')
 {
     $name = $viewname == 'freeze' || $viewname == 'curator' ? 'freeze' : 'draft';
     // Get selector styles
     \Hubzero\Document\Assets::addPluginStylesheet('projects', 'publications', 'selector');
     // Output HTML
     $view = new \Hubzero\Plugin\View(array('folder' => 'projects', 'element' => 'publications', 'name' => $name, 'layout' => 'license'));
     $view->pub = $pub;
     $view->manifest = $this->_manifest;
     $view->step = $this->_blockId;
     $objL = new \Components\Publications\Tables\License($this->_parent->_db);
     // Get selected license
     $view->license = $objL->getPubLicense($pub->version_id);
     $view->selections = $objL->getBlockLicenses($this->_manifest, $view->license);
     // Pre-select single available license
     if (!$view->license && count($view->selections) == 1) {
         $view->license = new \Components\Publications\Tables\License($this->_parent->_db);
         $view->license->load($view->selections[0]->id);
     }
     if ($this->getError()) {
         $view->setError($this->getError());
     }
     return $view->loadTemplate();
 }