public function __construct(Module $module, string $form = 'form-module-manager') { parent::__construct('manager.module.info'); $this->module = $module; $this->form = $form; $this->arguments = null; }
/** * Pager constructor. * @param int $count * @param string|null $path * @param array $settings */ public function __construct(int $count, string $path = null, array $settings = []) { $settings += ['pageKey' => 'page', 'results' => 30, 'showArrows' => true, 'disableArrows' => true, 'nextText' => 'Next', 'prevText' => 'Previous', 'alignOnSides' => false, 'leftArrow' => '←', 'rightArrow' => '→', 'queryString' => true]; $request = request(); if ($path === null) { $path = $request->path(); } if ($settings['queryString'] !== false) { if ($settings['queryString'] === true) { $settings['queryString'] = $request->get(); } unset($settings['queryString'][$settings['pageKey']]); $settings['queryString'] = http_build_query($settings['queryString']); if (!isset($settings['queryString'][0])) { $settings['queryString'] = false; } } $pageno = (int) $request->get($settings['pageKey'], 1); $settings['count'] = $count; $settings['path'] = $path; $settings['page'] = (int) $request->get($settings['pageKey'], 1); if ($pageno <= 0) { $pageno = 1; } $pages = ceil($count / $settings['results']); $page = $pageno - 1; $next = $page + 1; $prev = $page - 1; parent::__construct('pager', ['pageKey' => $settings['pageKey'], 'path' => $path, 'next' => $next < $pages ? $next + 1 : false, 'prev' => $prev >= 0 && $prev < $pages ? $prev + 1 : false, 'align' => (bool) $settings['alignOnSides'], 'showArrows' => (bool) $settings['showArrows'], 'nextText' => $settings['nextText'], 'prevText' => $settings['prevText'], 'leftArrow' => $settings['leftArrow'], 'rightArrow' => $settings['rightArrow'], 'disableArrows' => $settings['disableArrows'], 'queryString' => $settings['queryString']]); }
public function __construct(array $form = []) { $form += array('id' => 'form-module-manager', 'method' => 'post', 'action' => getURL('/module-manager/module')); $modules = array(); foreach (app()->getModules() as $module) { if (!$module->isHidden()) { $modules[$module->name()] = new ModuleInfo($module, $form['id']); } } ksort($modules); parent::__construct('manager.module.list', ['list' => $modules, 'form' => $form]); }
/** * Paginator constructor. * @param int $count * @param string|null $path * @param array $settings */ public function __construct(int $count, string $path = null, array $settings = []) { $settings += ['type' => 'pager', 'pageKey' => 'page', 'results' => 30, 'items' => 5, 'size' => 'normal', 'showArrows' => true, 'leftArrow' => '«', 'rightArrow' => '»', 'queryString' => true]; $request = request(); if ($path === null) { $path = $request->path(); } if ($settings['queryString'] !== false) { if ($settings['queryString'] === true) { $settings['queryString'] = $request->get(); } unset($settings['queryString'][$settings['pageKey']]); $settings['queryString'] = http_build_query($settings['queryString']); if (!isset($settings['queryString'][0])) { $settings['queryString'] = false; } } $pageno = (int) $request->get($settings['pageKey'], 1); if ($pageno <= 0) { $pageno = 1; } $pages = ceil($count / $settings['results']); $page = $pageno - 1; if ($settings['items'] <= 0) { $settings['items'] = 1; } $items = []; if ($page < $pages) { $mod = $page % $settings['items']; for ($i = 0, $p = $page - $mod, $s = $settings['items']; $i < $s; $i++, $p++) { if ($p >= $pages) { break; } $items[] = $p + 1; } } $next = $page + 1; $prev = $page - 1; $mapSize = ['normal' => 'pagination', 'large' => 'pagination pagination-lg', 'small' => 'pagination pagination-sm']; $class = isset($mapSize[$settings['size']]) ? $mapSize[$settings['size']] : 'pagination'; parent::__construct('paginator', ['class' => $class, 'page' => $pageno, 'pageKey' => $settings['pageKey'], 'path' => $path, 'items' => $items, 'showArrows' => (bool) $settings['showArrows'], 'next' => $next < $pages ? $next + 1 : false, 'prev' => $prev >= 0 ? $prev + 1 : false, 'leftArrow' => $settings['leftArrow'], 'rightArrow' => $settings['rightArrow'], 'queryString' => $settings['queryString']]); }
/** * Collection constructor. */ public function __construct() { parent::__construct('collection', ['items' => []]); }
/** * Script constructor. */ public function __construct() { parent::__construct('script', ['content' => null, 'attributes' => new Attributes()]); }
/** * Style constructor. * @param string|null $content * @param string|null $media */ public function __construct(string $content = null, string $media = null) { parent::__construct('css.style', ['content' => $content, 'media' => $media]); }
/** * Attributes constructor. */ public function __construct() { parent::__construct('attributes', ['attributes' => []]); }
/** * Link constructor. * @param string $href */ public function __construct(string $href) { parent::__construct('css.link', ['href' => $href]); }
public function __construct() { parent::__construct('html', ['title' => null, 'content' => null, 'icon' => null, 'styles' => new CSSCollection(), 'scripts' => new ScriptCollection(), 'meta' => new MetaCollection(), 'htmlAttributes' => null, 'bodyAttributes' => null]); }
/** * Alerts constructor. */ public function __construct() { parent::__construct('alerts'); $this->arguments = null; }
/** * Meta constructor. * @param bool $xhtml */ public function __construct(bool $xhtml = false) { parent::__construct('meta', ['xhtml' => $xhtml, 'attributes' => new Attributes()]); }