示例#1
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (isset($args[0]) && intval($args[0])) {
         $this->widgetArgs['count'] = $args[0];
     } else {
         throw new ThemeException('First argument (Page Count) is required for ' . self::WIDGET_NAME . ' element');
     }
     if (isset($args[1]) && intval($args[1])) {
         $this->widgetArgs['current'] = $args[1];
     } else {
         throw new ThemeException('Second argument (Current Page) is required for ' . self::WIDGET_NAME . ' element');
     }
     if (isset($args[2]) && $args[2] == true) {
         $this->widgetArgs['pager'] = 'pager';
     }
     if (!empty($args[3])) {
         if (!isset($this->avlSizes[$args[3]])) {
             throw new ThemeException('Second argument (Size) for ' . self::WIDGET_NAME . ' element is out of array of available sizes');
         }
         $this->widgetArgs['size'] = $this->avlSizes[$args[3]];
     }
     if (isset($args[4]) && $args[4] == true) {
         $this->widgetArgs['alt'] = true;
     }
 }
示例#2
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (isset($args[0])) {
         $this->widgetArgs['text'] = $args[0];
     } else {
         throw new ThemeException('First argument (Text) is required for ' . self::WIDGET_NAME . ' element');
     }
     if (isset($args[1]) && in_array($args[1], $this->avlColors)) {
         $this->widgetArgs['color'] = $args[1];
     }
 }
示例#3
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (isset($args[0])) {
         if (in_array($args[0], $this->avlIcons)) {
             $this->widgetArgs['icon'] = strtolower($args[0]);
         } else {
             throw new ThemeException('Icon name is out of available list');
         }
     } else {
         throw new ThemeException('First argument (Icon) is required for ' . self::WIDGET_NAME . ' element');
     }
 }
示例#4
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (!empty($args[0]) && in_array($args[0], $this->avlTooltipPositions)) {
         $this->widgetArgs['placement'] = $args[0];
     }
     if (!empty($args[1])) {
         $this->widgetArgs['contentHtml'] = $args[1];
     }
     if (!empty($args[2]) && $args[2] == true) {
         $this->widgetArgs['asHtml'] = $args[2];
     }
 }
示例#5
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (!empty($args[0]) && isset($this->avlSizes[$args[0]])) {
         $this->widgetArgs['size'] = $this->avlSizes[$args[0]];
     }
     if (!empty($args[1])) {
         $this->widgetArgs['bodyHtml'] = $args[1];
     }
     if (!empty($args[2])) {
         $this->widgetArgs['addClasses'] = $args[2];
     }
 }
示例#6
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (isset($args[0])) {
         if (isset($this->avlCodes[strtoupper($args[0])])) {
             $this->widgetArgs['code'] = strtolower($args[0]);
             $this->widgetArgs['countryName'] = $this->avlCodes[strtoupper($args[0])];
         } else {
             throw new ThemeException('Country code is incorrect');
         }
     } else {
         throw new ThemeException('First argument (Code) is required for ' . self::WIDGET_NAME . ' element');
     }
 }
示例#7
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (!empty($args[0]) && in_array($args[0], $this->avlBlockTypes)) {
         $this->widgetArgs['type'] = $args[0];
     }
     if (!empty($args[1]) && $args[1] == true) {
         $this->widgetArgs['showCloseBtn'] = $args[1];
     }
     if (!empty($args[2]) && $args[2] != 'default') {
         $this->widgetArgs['heading'] = $args[2];
     } else {
         $this->widgetArgs['heading'] = $this->widgetArgs['type'] . '!';
     }
     if (!empty($args[3])) {
         $this->widgetArgs['bodyHtml'] = $args[3];
     }
 }
示例#8
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (!empty($args[0]) && is_array($args[0])) {
         foreach ($args[0] as $tab) {
             if (!$tab[0]) {
                 throw new ThemeException('First argument (Tab title) for each Tab in Tabs data array is required for ' . self::WIDGET_NAME . ' element');
             }
             if (!$tab[1]) {
                 throw new ThemeException('Second argument (Tab HTML content) for each Tab in Tabs data array is required for ' . self::WIDGET_NAME . ' element');
             }
         }
         $this->widgetArgs['tabsData'] = $args[0];
     } else {
         throw new ThemeException('First argument (Tabs data) is required for ' . self::WIDGET_NAME . ' element and should be an array');
     }
     $this->widgetArgs['tabId'] = rand(0, 100);
 }
示例#9
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (!empty($args[0]) && in_array($args[0], $this->avlAlertTypes)) {
         $this->widgetArgs['type'] = $args[0];
     }
     if (!empty($args[1])) {
         $this->widgetArgs['icon'] = $args[1];
     }
     if (!empty($args[2])) {
         $this->widgetArgs['boldText'] = $args[2];
     }
     if (!empty($args[3])) {
         $this->widgetArgs['text'] = $args[3];
     }
     if (!empty($args[4]) && $args[4] == true) {
         $this->widgetArgs['showCloseBtn'] = $args[4];
     }
 }
示例#10
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (!empty($args[0]) && in_array($args[0], $this->avlTooltipPositions)) {
         $this->widgetArgs['placement'] = $args[0];
     }
     if (!empty($args[1])) {
         $this->widgetArgs['onHover'] = '-hover';
     }
     if (!empty($args[2])) {
         $this->widgetArgs['titleHtml'] = $args[2];
     }
     if (!empty($args[3])) {
         $this->widgetArgs['bodyHtml'] = $args[3];
     }
     if (!empty($args[4])) {
         $this->widgetArgs['asHtml'] = true;
     }
 }
示例#11
0
 /**
  * Create a new instance of Progress Bar Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (isset($args[0])) {
         $this->widgetArgs['percents'] = $args[0];
     } else {
         throw new ThemeException('First argument (PercentProgress) is required for ' . self::WIDGET_NAME . ' element');
     }
     if (isset($args[1]) && $args[1] == true) {
         $this->widgetArgs['rightAlignment'] = 'right';
     }
     if (!empty($args[2])) {
         $this->widgetArgs['progressText'] = $args[2];
     } else {
         $this->widgetArgs['progressText'] = $this->widgetArgs['percents'] . '%';
     }
     if (isset($args[3])) {
         $this->widgetArgs['progressTooltipHtml'] = $args[3];
     }
     if (isset($args[4]) && in_array($args[4], $this->avlTooltipPositions)) {
         $this->widgetArgs['progressTooltipPosition'] = $args[4];
     }
     if (!empty($args[5])) {
         $this->widgetArgs['verticalPosition'] = 'vertical';
     }
     if (!empty($args[6]) && $this->widgetArgs['verticalPosition'] == 'vertical') {
         $this->widgetArgs['wideVertical'] = 'wide-bar';
     }
     if (!empty($args[7])) {
         if (isset($this->avlHorizontalSizes[$args[7]])) {
             $this->widgetArgs['horizontalSize'] = $this->avlHorizontalSizes[$args[7]];
         } else {
             throw new ThemeException('Selected Horizontal_size param for ' . self::WIDGET_NAME . ' element doesn\'t exist');
         }
     }
     if (!empty($args[8])) {
         $this->widgetArgs['addCssClasses'] = $args[8];
     }
 }
示例#12
0
 /**
  * Create a new instance of Widget.
  *
  * @param  float $percent
  * @param  array $args
  * @return void
  */
 public function __construct(&$args, Factory $view, Repository $config)
 {
     parent::__construct($args, $view, $config);
     // initializing unique to widget variables
     if (isset($args[0])) {
         $this->widgetArgs['innerHtml'] = $args[0];
     } else {
         throw new ThemeException('First argument (InnerHTML) is required for ' . self::WIDGET_NAME . ' element');
     }
     if (isset($args[1])) {
         $this->widgetArgs['type'] = $args[1];
     }
     if (isset($args[2]) && isset($this->avlSizes[$args[2]])) {
         $this->widgetArgs['size'] = $this->avlSizes[$args[2]];
     }
     if (isset($args[3]) && $args[3] == true) {
         $this->widgetArgs['disabled'] = 'disabled';
     }
     if (isset($args[4]) && $args[4] == true) {
         $this->widgetArgs['circle'] = 'btn-circle';
     }
 }