Example #1
0
 public function setConfig($config = [])
 {
     parent::setConfig($config);
     if (($m = $this->getWidgetModel()) && ($structure = $m->structure) && ($this->newsCategoryId = array_get($structure, 'category_id'))) {
     } else {
         $this->newsCategoryUrl = app('router')->getCurrentRoute()->getParameter('news_category_url_pattern');
     }
     return $this;
 }
Example #2
0
 public function setConfig($config = [])
 {
     parent::setConfig($config);
     if ($m = $this->getWidgetModel()) {
         $structure = $m->structure;
         $this->perPage = array_get($structure, 'per_page') ?: $this->perPage;
         $this->categoryIds = (array) array_get($structure, 'category_ids');
         $this->ignorePage = (bool) array_get($structure, 'ignore_page', $this->ignorePage);
     } else {
         $this->perPage = (int) $this->getConfig('per_page', $this->perPage) ?: $this->perPage;
         $this->categoryIds = (array) $this->getConfig('category_ids', $this->categoryIds);
         $this->ignorePage = (bool) $this->getConfig('ignore_page', $this->ignorePage);
         $this->closureQuery = $this->getConfig('closure_query', $this->closureQuery);
     }
     $this->page = $this->getRequest()->get('p', $this->page);
     $this->newsCategoryUrlPattern = app('router')->getCurrentRoute()->getParameter('news_category_url_pattern');
     return $this;
 }
Example #3
0
 /**
  * @method setConfig
  * Set config of widget
  * @param {Array} $config
  * @member Telenok.Account.Widget.Login.Controller
  * @return {Telenok.Account.Widget.Login.Controller}
  */
 public function setConfig($config = [])
 {
     $config = collect($config)->all();
     parent::setConfig(array_merge($config, ['route_login' => array_get($config, 'route_login', $this->routeLogin), 'login_username' => array_get($config, 'login_username', $this->loginUsername), 'max_login_attempts' => array_get($config, 'max_login_attempts', $this->maxLoginAttempts), 'lockout_time' => array_get($config, 'lockout_time', $this->lockoutTime), 'guard' => array_get($config, 'guard', $this->guard), 'redirect_path' => array_get($config, 'redirect_path', $this->redirectPath), 'socialite' => array_get($config, 'socialite', $this->socialite)]));
     $this->routeLogin = $this->getConfig('route_login');
     $this->loginUsername = $this->getConfig('login_username');
     $this->maxLoginAttempts = $this->getConfig('max_login_attempts');
     $this->lockoutTime = $this->getConfig('lockout_time');
     $this->guard = $this->getConfig('guard');
     $this->redirectPath = $this->getConfig('redirect_path');
     $this->socialite = $this->getConfig('socialite');
     return $this;
 }