/**
  * Preparations for creating and editing
  */
 protected function createEditPrepare()
 {
     $this->createEditSnippets = $this->getTrackEngine()->getRoundEditSnippetNames();
     \MUtil_JQuery::enableView($this->view);
     $this->view->headScript()->appendFile($this->basepath->getBasePath() . '/gems/js/jquery.showOnChecked.js');
     if (\MUtil_Bootstrap::enabled()) {
         $this->view->headScript()->appendScript("jQuery(document).ready(function(\$) {\n                \$('input[name=\"organizations[]\"]').closest('div').showOnChecked( { showInput: \$('#org_specific_round-1') });\n            });");
     } else {
         $this->view->headScript()->appendScript("jQuery(document).ready(function(\$) {\n                \$('input[name=\"organizations[]\"]').closest('tr').showOnChecked( { showInput: \$('#org_specific_round-1') });\n            });");
     }
 }
 /**
  * Set this organization as teh one currently active
  *
  * @return \Gems_User_Organization (continutation pattern)
  */
 public function setAsCurrentOrganization()
 {
     $organizationId = $this->getId();
     if ($organizationId && !\Gems_Cookies::setOrganization($organizationId, $this->basepath->getBasePath())) {
         throw new \Exception('Cookies must be enabled for this site.');
     }
     $escort = \GemsEscort::getInstance();
     if ($escort instanceof \Gems_Project_Layout_MultiLayoutInterface) {
         $escort->layoutSwitch($this->getStyle());
     }
     return $this;
 }
 /**
  * Create the snippets content
  *
  * This is a stub function either override getHtmlOutput() or override render()
  *
  * @param \Zend_View_Abstract $view Just in case it is needed here
  * @return \MUtil_Html_HtmlInterface Something that can be rendered
  */
 public function getHtmlOutput(\Zend_View_Abstract $view)
 {
     $tabs = $this->getTabs();
     $tabCount = count($tabs);
     if ($tabs && ($this->displaySingleTab || $tabCount > 1)) {
         // Is there a better helper to include JS?
         $view->headScript()->appendFile($this->basepath->getBasePath() . '/gems/js/jquery.horizontalScrollMenu.js');
         $script = '(function($) {$(".' . $this->class . '").horizontalScrollMenu();}(jQuery));';
         $view->inlineScript()->appendScript($script);
         // Set the correct parameters
         $this->getCurrentTab();
         $scrollContainer = \MUtil_Html::create()->div();
         if ($tabCount > $this->scrollFromSize) {
             $scrollContainer->a('#', $this->prevLabel, array('class' => 'prev'));
         } else {
             $scrollContainer->span(array('class' => 'prev disabled'))->raw(str_repeat('&nbsp', strlen($this->prevLabel)));
         }
         $tabRow = $scrollContainer->div(array('class' => 'container'))->ul();
         foreach ($tabs as $tabId => $content) {
             $li = $tabRow->li(array('class' => $this->tabClass));
             if (strlen($content) > $this->tabLabelLength) {
                 $content = substr($content, 0, $this->tabLabelLength) . $this->tabLabelCutOffString;
             }
             $li->a($this->getParameterKeysFor($tabId) + $this->href, $content);
             if ($tabId == $this->currentTab) {
                 $li->appendAttrib('class', $this->tabActiveClass);
             }
         }
         if ($tabCount > $this->scrollFromSize) {
             $scrollContainer->a('#', $this->nextLabel, array('class' => 'next'));
         } else {
             $scrollContainer->span(array('class' => 'next disabled'))->raw(str_repeat('&nbsp', strlen($this->nextLabel)));
         }
         return $scrollContainer;
     } else {
         return null;
     }
 }
예제 #4
0
 public function getImageUri($imageFile)
 {
     return $this->basepath->getBasePath() . '/' . $this->project->imagedir . '/' . $imageFile;
 }