/** * isValid Checks if group exists in db using Groups model's function * * @param $value string group name * @return boolean */ public function isValid($value) { $value = Oibs_Controller_CustomController::replaceWhitespace($value); $this->_setValue($value); $groupModel = new Default_Model_Groups(); if (is_array($this->_options) && array_key_exists('oldname', $this->_options)) { // Edit mode - name can be the same as 'oldname'. //die('edit mode, oldname = ' . $options['oldname']); if ($value == $this->_options['oldname']) { // Name hasn't changed, so it's still valid. return true; } else { // Name has changed - check if it exists. if ($groupModel->groupExists($value)) { $this->_error(self::NOT_MATCH); return false; // if the group exists, the form is not valid } else { return true; // if the group doesn't exist, the form is valid } } } else { // Create mode - check normally. if ($groupModel->groupExists($value)) { $this->_error(self::NOT_MATCH); return false; // if the group exists, the form is not valid } else { return true; // if the group doesn't exist, the form is valid } } }
/** * init * * Initialization of account controller. * */ public function init() { parent::init(); $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('login', 'html')->initContext(); $this->view->title = 'account-title'; }
/** * init * * Initialization of content controller * */ public function init() { parent::init(); $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('list', 'xml')->initContext(); $this->baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); $this->view->title = 'content-title'; }
public function init() { parent::init(); // Disable layout to be rendered $this->_helper->layout->disableLayout(); // Set variables available for access in all actions in this class. $this->params = $this->getRequest()->getParams(); //$this->id = isset($this->params['id']) ? (int)$this->params['id'] : 0; }
public function init() { parent::init(); // For debugging purposes set to true $this->debug = true; $ajaxRequest = $this->debug ? true : $this->_request->isXmlHttpRequest(); // If requested via ajax if ($ajaxRequest) { // Disable layout to be rendered $this->_helper->layout->disableLayout(); // Set variables available for access in all actions in this class. $this->params = $this->getRequest()->getParams(); } else { echo "No go :("; die; } }
public function init() { parent::init(); // Get authentication $auth = Zend_Auth::getInstance(); // If user has identity if ($auth->hasIdentity()) { if (!in_array("admin", $this->view->logged_user_roles)) { $message = 'admin-no-permission'; $url = $this->_urlHelper->url(array('controller' => 'msg', 'action' => 'index', 'language' => $this->view->language), 'lang_default', true); $this->flash($message, $url); } } else { $message = 'admin-no-permission'; $url = $this->_urlHelper->url(array('controller' => 'msg', 'action' => 'index', 'language' => $this->view->language), 'lang_default', true); $this->flash($message, $url); } $this->view->title = "OIBS"; $this->baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); }
public function init() { parent::init(); $this->view->title = 'account-login-title'; }
/** * init * * Initialization of tag controller * */ public function init() { parent::init(); $this->view->title = 'tag-view-title'; //$this->breadcrumbs->addStep('Tag', $this->getUrl(null, 'tag')); }
public function init() { $this->view->title = 'privmsg-index-title'; parent::init(); }
public function init() { parent::init(); $this->view->title = 'search-title'; }
public function init() { parent::init(); }
public function init() { parent::init(); $this->view->title = 'comment-title'; }
public function init() { parent::init(); $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('index', 'html')->initContext(); }
public function init() { parent::init(); $this->view->title = 'voice-title'; }