Esempio n. 1
0
 function save()
 {
     if ($this->pagedata['ID'] != null) {
         $user_page = SJB_System::getUserPage($this->pagedata['uri']);
         if (!is_null($user_page) && $user_page['ID'] != $this->pagedata['ID']) {
             $this->error['PAGE_ALREADY_EXISTS'] = 1;
             return false;
         }
         if (!SJB_System::modifyUserPage($this->pagedata)) {
             $this->error['CHANGE_ERROR'] = 'Cannot change data of User Page';
             return false;
         }
     } else {
         if (!SJB_System::addUserPage($this->pagedata)) {
             $this->error['ADD_ERROR'] = 'Cannot add new User Page';
             return false;
         }
     }
     return true;
 }