Example #1
0
 /**
  * Magic setter.
  *
  * @param string $strName
  * @param string $mixValue
  * @throws \QCallerException
  * @throws \QInvalidCastException
  */
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case "StyleClass":
             // One of Bootstrap::ButtonDefault, ButtonPrimary, ButtonSuccess, ButtonInfo, ButtonWarning, ButtonDanger
             $this->SetStyleClass($mixValue);
             break;
         case "SizeClass":
             // One of Bootstrap::ButtonLarge, ButtonMedium, ButtonSmall, ButtonExtraSmall
             $this->SetSizeClass($mixValue);
             break;
         case "AsButton":
             $this->blnAsButton = QType::Cast($mixValue, QType::Boolean);
             if ($this->blnAsButton) {
                 $this->AddCssClass("btn");
                 $this->AddCssClass($this->strButtonStyle);
                 if ($this->strButtonSize) {
                     $this->AddCssClass($this->strButtonSize);
                 }
                 if (!$this->blnSplit) {
                     $this->AddCssClass("dropdown-toggle");
                 }
                 $this->RemoveWrapperCssClass("dropdown");
                 $this->AddWrapperCssClass("btn-group");
             } else {
                 $this->RemoveCssClass("btn");
                 $this->RemoveCssClassesByPrefix("btn-");
                 $this->AddWrapperCssClass("dropdown");
                 $this->RemoveWrapperCssClass("btn-group");
             }
             break;
         case "Split":
             $this->blnSplit = QType::Cast($mixValue, QType::Boolean);
             if (!$this->blnSplit) {
                 $this->AddCssClass("dropdown-toggle");
             } else {
                 $this->RemoveCssClass("dropdown-toggle");
             }
             break;
         case "Up":
             $this->blnUp = QType::Cast($mixValue, QType::Boolean);
             if ($this->blnUp) {
                 $this->AddWrapperCssClass("dropup");
             } else {
                 $this->RemoveWrapperCssClass("dropup");
             }
             break;
         case "Text":
             // overload Name as Text too.
             parent::__set("Name", $mixValue);
             break;
         default:
             try {
                 parent::__set($strName, $mixValue);
             } catch (\QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
     }
 }
Example #2
0
 public function AddMenuItem(NavbarItem $objMenuItem)
 {
     parent::AddItem($objMenuItem);
 }
Example #3
0
 /**
  * @param string $strName
  * @param string $mixValue
  * @throws QCallerException
  * @throws \Exception
  * @throws \QCallerException
  * @throws \QInvalidCastException
  */
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case 'ButtonStyle':
             try {
                 $buttonStyle = QType::Cast($mixValue, QType::String);
                 $this->RemoveCssClass(Bootstrap::NavPills);
                 $this->RemoveCssClass(Bootstrap::NavTabs);
                 $this->AddCssClass($buttonStyle);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
         case 'Justified':
             try {
                 $blnJustified = QType::Cast($mixValue, QType::Boolean);
                 if ($blnJustified) {
                     $this->AddCssClass(Bootstrap::NavJustified);
                 } else {
                     $this->RemoveCssClass(Bootstrap::NavJustified);
                 }
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
         default:
             try {
                 parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
     }
 }
Example #4
0
 public function GetEndScript()
 {
     \QApplication::ExecuteControlCommand($this->ControlId, 'on', 'click', '.item', new \QJsClosure("jQuery(this).trigger('bscarousselect', this.id)"), \QJsPriority::High);
     return parent::GetEndScript();
 }