Пример #1
0
 public function checkInput(array $args = array(), $suppress = 0, $priority = 'dd')
 {
     $isvalid = parent::checkInput($args, $suppress, $priority);
     // If the rest of the publication is valid, then do the access part
     // Note this is a collection of access properties; hence the complicated process of saving it
     if ($isvalid) {
         $access = DataPropertyMaster::getProperty(array('name' => 'access'));
         $prefix = $this->getFieldPrefix();
         // Only ignore the prefix if we are CREATING the base document
         // A translation would have a prefix of 0, which is valid
         if (empty($prefix) && $prefix !== '0') {
             $name = "dd_" . $this->properties['access']->id;
         } else {
             $name = $prefix . "_dd_" . $this->properties['access']->id;
         }
         $validprop = $access->checkInput($name . "_display");
         $displayaccess = $access->value;
         $isvalid = $isvalid && $validprop;
         $validprop = $access->checkInput($name . "_modify");
         $modifyaccess = $access->value;
         $isvalid = $isvalid && $validprop;
         $validprop = $access->checkInput($name . "_delete");
         $deleteaccess = $access->value;
         $isvalid = $isvalid && $validprop;
         $allaccess = array('display' => $displayaccess, 'modify' => $modifyaccess, 'delete' => $deleteaccess);
         $this->properties['access']->setValue($allaccess);
     }
     return $isvalid;
 }