public function validateField_name()
 {
     $bookingFields = Xcck_Utils::getOrderList($this->_mDirname);
     $fieldName = $this->mFormProperties['field_name']->get();
     if ($this->mFormProperties['definition_id']->get() == 0 && in_array($fieldName, $bookingFields)) {
         $this->mErrorFlag = true;
         $this->addErrorMessage(_MD_XCCK_ERROR_INVALID_FIELD_NAME . implode(',', $bookingFields));
     }
 }
Beispiel #2
0
 /**
  * loadPrevNext
  * 
  * @param   int        $order
  * 
  * @return  void
  */
 public function loadPrevNext($order = null)
 {
     if ($this->_mIsPrevNextLoaded == false) {
         $handler = Legacy_Utils::getModuleHandler('page', $this->getDirname());
         $order = isset($order) ? $order : Xcck_Utils::getModuleConfig($this->getDirname(), 'default_order');
         $orderList = Xcck_Utils::getOrderList($this->getDirname());
         //previous object
         if ($order > 0) {
             $condA = '<=';
             $condB = '<';
             $sort = 'ASC';
         } else {
             $condA = '>=';
             $condB = '>';
             $sort = 'DESC';
         }
         $cri = new CriteriaCompo();
         $cri->add(new Criteria($orderList[abs($order)], $this->get($orderList[abs($order)]), $condA));
         $cri->add(new Criteria('page_id', $this->get('page_id'), $condB));
         $cri->setSort($orderList[abs($order)], $sort);
         $prevObj = $handler->getObjects($cri, 1, 0);
         $this->mPrev = count($prevObj) > 0 ? array_shift($prevObj) : null;
         //next object
         if ($order > 0) {
             $condA = '>=';
             $condB = '>';
             $sort = 'ASC';
         } else {
             $condA = '<=';
             $condB = '<';
             $sort = 'DESC';
         }
         $cri = new CriteriaCompo();
         $cri->add(new Criteria($orderList[abs($order)], $this->get($orderList[abs($order)]), $condA));
         $cri->add(new Criteria('page_id', $this->get('page_id'), $condB));
         $cri->setSort($orderList[abs($order)], $sort);
         $nextObj = $handler->getObjects($cri, 1, 0);
         $this->mNext = count($nextObj) > 0 ? array_shift($nextObj) : null;
         $this->_mIsPrevNextLoaded = true;
     }
 }