public function __construct(array $models, $tableAction, $modelAction = null) { ksort($models); parent::__construct($models, $tableAction, self::NAME); $this->addDecorator(new ZebraDecorator(new ModelDecorator($modelAction))); // $this->addDecorator(new BuilderTableActionDecorator($basePath . '/scaffold/', 'orm.button.scaffold')); }
/** * Constructs a new connection table * @param array $connections Array with Connection instances * @param string $formAction URL where the form of the table will point to * @param string $connectionAction URL where the name of a connection will point to * @param string $exportAction URL to the export action * @param string $defaultConnection Name of the default connection * @return null */ public function __construct(array $connections, $formAction, $connectionAction = null, $exportAction = null, $defaultConnection = null) { parent::__construct($connections, $formAction, self::NAME); $this->addDecorator(new OptionDecorator()); $this->addDecorator(new ZebraDecorator(new ConnectionDecorator($connectionAction, $defaultConnection))); $this->addDecorator(new StatusDecorator()); $this->addDecorator(new ExportActionDecorator($exportAction)); }
/** * Constructs a new model field table * @param zibo\library\orm\definition\ModelTable $table Table containing the fields * @param string $fieldAction URL to the action of a field * @param string $modelAction URL to the action of a model * @return null */ public function __construct(ModelTable $table, $tableAction, $fieldAction = null, $modelAction = null) { $fields = $table->getFields(); unset($fields[ModelTable::PRIMARY_KEY]); parent::__construct($fields, $tableAction, self::NAME); $this->addDecorator(new ZebraDecorator(new ModelFieldDecorator($fieldAction, $modelAction))); $this->addDecorator(new ModelFieldLabelDecorator()); $this->addDecorator(new ModelFieldFlagsDecorator()); }
/** * Constructs a new security table * @param string $formAction URL where the form of the table will point to * @return null */ public function __construct($formAction) { $manager = SecurityManager::getInstance(); $permissions = $manager->getPermissions(); $roles = $manager->getRoles(); $deniedRoutes = $manager->getDeniedRoutes(); parent::__construct($permissions, $formAction, self::FORM_NAME); $this->addDecorators($roles); $this->addFields($deniedRoutes); }
/** * Constructs a new modules table * @param string $action URL where the form of the table will point to * @param array $modules Array with Module objects * @return null */ public function __construct($action, array $modules) { $modules = $this->getModules($modules); $modules = $this->orderByName($modules); parent::__construct($modules, $action, self::NAME); $this->addDecorator(new ZebraDecorator(new ModuleDecorator())); $this->addDecorator(new ReinstallActionDecorator($action . '/reinstall/')); $this->addDecorator(new UninstallActionDecorator($action . '/uninstall/')); // $this->setPaginationOptions(array(5, 10, 25, 50, 100)); // $this->setPagination(10); $this->setHasSearch(true); }
/** * Constructs a new cron job table * @param array $cronJobs Array with CronJob objects * @param string $formAction URL where the form of the table will point to * @return null */ public function __construct(array $cronJobs, $formAction) { parent::__construct($cronJobs, $formAction, self::NAME); $translator = I18n::getInstance()->getTranslator(); $translationInvoke = $translator->translate(self::TRANSLATION_INVOKE); $options = array(); foreach ($cronJobs as $cronJob) { $options[$cronJob->getId()] = $translationInvoke; } $fieldFactory = FieldFactory::getInstance(); $buttonInvoke = $fieldFactory->createField(FieldFactory::TYPE_SUBMIT, self::BUTTON_INVOKE); $buttonInvoke->setIsMultiple(true); $buttonInvoke->setOptions($options); $this->form->addField($buttonInvoke); $this->addDecorator(new ZebraDecorator(new IntervalDecorator()), new StaticDecorator(self::TRANSLATION_INTERVAL, true)); $this->addDecorator(new CallbackDecorator(), new StaticDecorator(self::TRANSLATION_CALLBACK, true)); $this->addDecorator(new InvokeDecorator($this->form)); }
/** * Constructs a new clipboard table * @param string $action URL where the table form will point to * @param zibo\library\filesystem\File $root Path of the root for the filebrowser * @param array $files The values for the table: array with File objects * @return null */ public function __construct($action, File $root, array $files) { parent::__construct($files, $action, self::FORM_NAME); $this->addDecorator(new FileOptionDecorator()); $this->addDecorator(new ZebraDecorator(new ClipboardFileDecorator($root))); }
/** * Constructs a new namespace table * @param array $namespaces Array with ModuleNamespace objects, the data of the table * @param string $namespaceAction URL where the name of a namespace will point to, the name of the namespace will be concatted to the action * @param string $tableAction URL where the form of this table will point to * @return null */ public function __construct(array $namespaces, $namespaceAction = null, $tableAction = null) { parent::__construct($namespaces, $tableAction, self::FORM_NAME); $this->setHasSearch(true); $this->addDecorator(new NamespaceDecorator($namespaceAction)); }
public function __construct(array $values, array $parents, $formAction, $formName = null) { parent::__construct($values, $formAction, $formName); $this->breadcrumbs = new Breadcrumbs(); $this->parents = $parents; }
/** * Constructs a new module version table * @param array $versions Array with Module objects * @param string $versionAction URL for the version link * @param string $tableAction URL for the table form * @return null */ public function __construct(array $versions, $versionAction = null, $tableAction = null) { parent::__construct($versions, $tableAction, self::FORM_NAME); $this->addDecorator(new ModuleVersionDecorator($versionAction)); }
/** * Constructs a new model table * @param zibo\library\orm\model\Model $model * @param string $formAction URL where the form will point to */ public function __construct(Model $model, $formAction) { $this->model = $model; $this->query = $model->createQuery(); parent::__construct(array(), $formAction, self::FORM_NAME . $this->model->getName()); }