Пример #1
0
 /**
  * (non-PHPdoc)
  * @see \Simplify\Form\Element::onRender()
  */
 public function onRender(\Simplify\Form\Action $action, $data, $index)
 {
     $params = array('formAction' => 'services', 'serviceName' => $this->getName(), 'serviceAction' => 'toggle', \Simplify\Form::ID => $data[\Simplify\Form::ID]);
     $this->set('ajaxUrl', \Simplify\URL::make(null, $params)->format(\Simplify\URL::JSON));
     $this->set('jsName', str_replace(array('[', ']'), array('\\\\[', '\\\\]'), $this->getInputName($index) . '[]'));
     $this->set('useAjax', $action->show(\Simplify\Form::ACTION_LIST));
     return parent::onRender($action, $data, $index);
 }
Пример #2
0
 /**
  *
  * @return array
  */
 protected function findFiles()
 {
     $baseUrl = \Simplify::config()->get('www:url');
     $baseDir = \Simplify::config()->get('www:dir');
     $files = glob($baseDir . $this->path . '/' . '*.{' . implode(',', $this->extensions) . '}', GLOB_BRACE);
     $selectUrl = \Simplify\URL::make(null, null, true)->set('browserAction', self::ACTION_SELECT);
     foreach ($files as &$file) {
         $file = substr($file, strlen($baseDir));
         $file = array('filename' => $file, 'url' => $baseUrl . $file, 'selectUrl' => $selectUrl->extend()->set('file', $file), 'thumbUrl' => $this->getThumbUrl($file, 128, 128), 'imageUrl' => $this->getThumbUrl($file));
     }
     return $files;
 }
Пример #3
0
 /**
  *
  * @return \Simplify\Menu
  */
 protected function createMenu()
 {
     $this->menu = new \Simplify\Menu('amp');
     if (Account::validate('manage_accounts', true)) {
         $accountsMenu = new \Simplify\Menu('accounts', null, __('Usuários'));
         $_users = new \Simplify\MenuItem('users', __('Usuários'), null, new \Simplify\URL('route://admin_users'));
         $_add_user = new \Simplify\MenuItem('add_user', __('Adicionar usuário'), null, new \Simplify\URL('route://admin_users', array('formAction' => 'create')));
         $accountsMenu->addItem($_users);
         $accountsMenu->addItem($_add_user);
         $this->menu->addItem($accountsMenu);
         if (Account::validate('manage_groups', true)) {
             $_groups = new \Simplify\MenuItem('groups', 'Grupos', null, new \Simplify\URL('route://admin_groups'));
             $_add_group = new \Simplify\MenuItem('add_group', __('Criar grupo'), null, new \Simplify\URL('route://admin_groups', array('formAction' => 'create')));
             $groupsMenu = new \Simplify\Menu('groups', null, __('Grupos'));
             $groupsMenu->addItem($_groups);
             $groupsMenu->addItem($_add_group);
             $accountsMenu->addItem($groupsMenu);
         }
         if (Account::validate('manage_permissions', true)) {
             $_perms = new \Simplify\MenuItem('permissions', __('Permissões'), null, new \Simplify\URL('route://admin_permissions'));
             $_add_perm = new \Simplify\MenuItem('add_permission', __('Criar permissão'), null, new \Simplify\URL('route://admin_permissions', array('formAction' => 'create')));
             $permsMenu = new \Simplify\Menu('permissions', null, __('Permissões'));
             $permsMenu->addItem($_perms);
             $permsMenu->addItem($_add_perm);
             $accountsMenu->addItem($permsMenu);
         }
     }
     if (Account::validate('manage_options', true)) {
         $optionsMenu = new \Simplify\Menu('options', null, __('Opções'));
         $general = new \Simplify\MenuItem('general', 'Geral', null, new \Simplify\URL('route://admin_options'));
         $modules = new \Simplify\MenuItem('modules', 'Módulos', 'options', new \Simplify\URL('route://admin_modules'));
         $email = new \Simplify\MenuItem('email', 'Email', null, \Simplify\URL::make('route://admin_options_email'));
         $optionsMenu->addItem($general);
         $optionsMenu->addItem($modules);
         $optionsMenu->addItem($email);
         $this->menu->addItem($optionsMenu);
     }
     \Amplify\Modules::executeCallback('onCreateMenu', $this->menu);
 }
Пример #4
0
 /**
  *
  * @param string $serviceAction
  * @return URL
  */
 public function getServiceUrl($serviceAction)
 {
     $uploaderUrl = URL::make(null, null, false, null, URL::JSON);
     $uploaderUrl->set('formAction', 'services');
     $uploaderUrl->set('serviceName', $this->getName());
     $uploaderUrl->set('serviceAction', $serviceAction);
     return $uploaderUrl;
 }
Пример #5
0
 protected function _remove()
 {
     return $this->extend ? array_merge($this->extend->_remove(), $this->remove) : $this->remove;
 }