Ejemplo n.º 1
0
 /**
  *   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
         }
     }
 }
Ejemplo n.º 2
0
 /**
  *    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';
 }
Ejemplo n.º 3
0
 /**
  *   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';
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
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;
     }
 }
Ejemplo n.º 6
0
 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();
 }
Ejemplo n.º 7
0
 public function init()
 {
     parent::init();
     $this->view->title = 'account-login-title';
 }
Ejemplo n.º 8
0
 /**
  *	init
  *	
  *	Initialization of tag controller
  *
  */
 public function init()
 {
     parent::init();
     $this->view->title = 'tag-view-title';
     //$this->breadcrumbs->addStep('Tag', $this->getUrl(null, 'tag'));
 }
Ejemplo n.º 9
0
 public function init()
 {
     $this->view->title = 'privmsg-index-title';
     parent::init();
 }
Ejemplo n.º 10
0
 public function init()
 {
     parent::init();
     $this->view->title = 'search-title';
 }
Ejemplo n.º 11
0
 public function init()
 {
     parent::init();
 }
Ejemplo n.º 12
0
 public function init()
 {
     parent::init();
     $this->view->title = 'comment-title';
 }
Ejemplo n.º 13
0
 public function init()
 {
     parent::init();
     $ajaxContext = $this->_helper->getHelper('AjaxContext');
     $ajaxContext->addActionContext('index', 'html')->initContext();
 }
Ejemplo n.º 14
0
 public function init()
 {
     parent::init();
     $this->view->title = 'voice-title';
 }