コード例 #1
1
ファイル: update.class.php プロジェクト: soulcreate/Tickets
 /**
  * @return bool
  */
 public function afterSave()
 {
     $new_thread = $this->object->get('thread');
     if ($this->old_thread != $new_thread) {
         $this->object->changeThread($this->old_thread, $new_thread);
     } else {
         $this->object->clearTicketCache();
     }
     return parent::afterSave();
 }
コード例 #2
1
ファイル: update.class.php プロジェクト: KANU82/easyComm
 /** {@inheritDoc} */
 public function afterSave()
 {
     /*
     $this->thread->fromArray(array(
         'comment_last' => $this->object->get('id'),
         'comment_time' => $this->object->get('createdon'),
     ));
     $this->thread->save();
     */
     $this->thread->updateLastMessage();
     /* @var ecMessage $m */
     if ($m = $this->modx->getObject('ecMessage', $this->getProperty('id'))) {
         if ($m->notifyUser()) {
             $m->set('notify', 0);
             $m->set('notify_date', date('Y-m-d H:i:s'));
             $m->save();
         }
     }
     return parent::afterSave();
 }
コード例 #3
0
 public function afterSave()
 {
     /** @var xPDOFileCache $provider */
     $provider = $this->modx->cacheManager->getCacheProvider('oauth2server');
     $provider->flush();
     return parent::afterSave();
 }
コード例 #4
0
 public function afterSave()
 {
     if ($this->modx->hasPermission('usergroup_user_edit')) {
         $this->addUsers();
     }
     return parent::afterSave();
 }
コード例 #5
0
 public function afterSave()
 {
     $this->updateTranslations($this->getProperties());
     $this->refreshURIs();
     $this->clearCache();
     return parent::afterSave();
 }
コード例 #6
0
 public function afterSave()
 {
     /* now store the permissions into the modAccessPermission table */
     /* and cache the data into the policy table */
     $permissions = $this->getProperty('permissions', null);
     if ($permissions !== null) {
         $permissions = is_array($permissions) ? $permissions : $this->modx->fromJSON($permissions);
         /* first erase all prior permissions */
         $oldPermissions = $this->object->getMany('Permissions');
         /** @var modAccessPermission $permission */
         foreach ($oldPermissions as $permission) {
             $permission->remove();
         }
         $added = array();
         foreach ($permissions as $permissionArray) {
             if (in_array($permissionArray['name'], $added)) {
                 continue;
             }
             $permission = $this->modx->newObject('modAccessPermission');
             $permission->set('template', $this->object->get('id'));
             $permission->set('name', $permissionArray['name']);
             $permission->set('description', $permissionArray['description']);
             $permission->set('value', true);
             $permission->save();
             $added[] = $permissionArray['name'];
         }
     }
     return parent::afterSave();
 }
コード例 #7
0
ファイル: update.class.php プロジェクト: raadhuis/modx-basic
 /**
  * {@inheritDoc}
  *
  * @return mixed
  */
 public function afterSave()
 {
     if ($this->refreshURIs) {
         $this->modx->call('modResource', 'refreshURIs', array(&$this->modx));
     }
     return parent::afterSave();
 }
コード例 #8
0
ファイル: update.class.php プロジェクト: Jako/formz
 public function afterSave()
 {
     $this->saveRequired();
     if ($this->validationType) {
         $this->saveValidation();
     }
     return parent::afterSave();
 }
コード例 #9
0
 public function afterSave()
 {
     $this->clearOldRules();
     $this->setFieldRules();
     $this->setTabRules();
     $this->setTVRules();
     $this->saveNewRules();
     return parent::afterSave();
 }
コード例 #10
0
ファイル: vote.class.php プロジェクト: jolichter/modxTalks
 /**
  * After save
  * Add comment to cache
  *
  * @return void
  */
 public function afterSave()
 {
     if ($this->modx->modxtalks->mtCache === true) {
         if (!$this->modx->modxtalks->cacheComment($this->object)) {
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/vote] Cache comment error, ID ' . $this->object->id);
         }
     }
     return parent::afterSave();
 }
コード例 #11
0
ファイル: update.class.php プロジェクト: sfgoo/virtualpage
 /** {@inheritDoc} */
 public function afterSave()
 {
     if ($event = $this->modx->getObject('vpEvent', $this->object->get('event'))) {
         $eventName = $event->get('name');
         /* set event */
         $this->modx->virtualpage->doEvent('create', $eventName, 'vpEvent', 10);
     }
     return parent::afterSave();
 }
コード例 #12
0
 public function afterSave()
 {
     /* now store the permissions into the modAccessPermission table */
     /* and cache the data into the policy table */
     $permissions = $this->getProperty('permissions', null);
     if ($permissions !== null) {
         $new_permissions_list = array();
         if (!is_array($permissions)) {
             $permissions = $this->modx->fromJSON($permissions);
             foreach ($permissions as $permission_item) {
                 $new_permissions_list[] = $permission_item['name'];
             }
         } else {
             $new_permissions_list = $permissions;
         }
         $deleted = array();
         /* first erase all prior permissions */
         $oldPermissions = $this->object->getMany('Permissions');
         /** @var modAccessPermission $permission */
         foreach ($oldPermissions as $permission) {
             if (!in_array($permission->get('name'), $new_permissions_list)) {
                 $deleted[] = $permission->get('name');
             }
             $permission->remove();
         }
         $added = array();
         foreach ($permissions as $permissionArray) {
             if (in_array($permissionArray['name'], $added)) {
                 continue;
             }
             $permission = $this->modx->newObject('modAccessPermission');
             $permission->set('template', $this->object->get('id'));
             $permission->set('name', $permissionArray['name']);
             $permission->set('description', $permissionArray['description']);
             $permission->set('value', true);
             $permission->save();
             $added[] = $permissionArray['name'];
         }
         // update all existing policies if needed
         if (!empty($deleted)) {
             $policies = $this->object->getMany('Policies');
             /** @var modAccessPolicy $policy */
             foreach ($policies as $policy) {
                 $policy_data = $policy->get('data');
                 foreach ($deleted as $deleted_perm) {
                     if (isset($policy_data[$deleted_perm])) {
                         unset($policy_data[$deleted_perm]);
                     }
                 }
                 $policy->set('data', $policy_data);
                 $policy->save();
             }
         }
     }
     return parent::afterSave();
 }
コード例 #13
0
 public function afterSave()
 {
     $this->action = $this->object->getOne('Action');
     $this->clearOldRules();
     $this->setFieldRules();
     $this->setTabRules();
     $this->setTVRules();
     $this->saveNewRules();
     return parent::afterSave();
 }
コード例 #14
0
ファイル: undelete.class.php プロジェクト: soulcreate/Tickets
 /**
  * @return bool
  */
 public function afterSave()
 {
     $this->object->clearTicketCache();
     /* @var TicketThread $thread */
     if ($thread = $this->object->getOne('Thread')) {
         $thread->updateLastComment();
     }
     $this->modx->cacheManager->delete('tickets/latest.comments');
     $this->modx->cacheManager->delete('tickets/latest.tickets');
     return parent::afterSave();
 }
コード例 #15
0
ファイル: update.class.php プロジェクト: vgrish/mlmsystem
 public function afterSave()
 {
     /* выполняем уведомления */
     if ($this->object->get('status') != $this->status) {
         $this->MlmSystem->Tools->sendNotice($this->object);
     }
     /* генерируем пути */
     if ($this->object->get('parent') != $this->parent) {
         $this->MlmSystem->Paths->removePathItem($this->object->get('id'));
         $this->MlmSystem->Paths->GeneratePaths($this->object->get('id'));
     }
     return parent::afterSave();
 }
コード例 #16
0
ファイル: update.class.php プロジェクト: Vitaliz/miniShop2
 public function afterSave()
 {
     $categories = $this->getCategories();
     if (is_array($categories)) {
         if (!empty($categories)) {
             $categories = $this->object->setCategories($categories);
         }
         // удаляем категории, которые не были установлены
         $this->removeNotAssignedCategories($categories);
         $this->object->set('categories', $categories);
     }
     $this->updateAssignedCategory();
     $this->updateOldKeys();
     return parent::afterSave();
 }
コード例 #17
0
 public function afterSave()
 {
     $delivery_id = $this->object->get('id');
     $this->modx->exec("DELETE FROM {$this->modx->getTableName('msDeliveryMember')} WHERE `delivery_id` = {$delivery_id};");
     /* @var msDeliveryMember $entry */
     $payments = $this->getProperty('payments');
     if (!empty($payments) && is_array($payments)) {
         foreach ($payments as $payment => $v) {
             if ($v == 1) {
                 $entry = $this->modx->newObject('msDeliveryMember');
                 $entry->fromArray(array('delivery_id' => $delivery_id, 'payment_id' => $payment), '', true);
                 $entry->save();
             }
         }
     }
     return parent::afterSave();
 }
コード例 #18
0
 /** {@inheritDoc} */
 public function afterSave()
 {
     if ($this->old_name != $this->object->get('file')) {
         $this->object->rename($this->object->get('file'), $this->old_name);
     }
     $children = $this->object->getMany('Children');
     if (!empty($children)) {
         /* @var msProductFile $child */
         foreach ($children as $child) {
             $child->fromArray(array('name' => $this->object->get('name'), 'description' => $this->object->get('description')));
             $child->save();
         }
     }
     /** @var msProduct $product */
     if ($product = $this->object->getOne('Product')) {
         $product->updateProductImage();
     }
     return parent::afterSave();
 }
コード例 #19
0
 public function afterSave()
 {
     $tags = $this->getProperty('tags', null);
     if ($tags !== null) {
         $tagNames = explode(',', $tags);
         $oldTags = $this->object->getMany('Tags');
         /** @var galTag $oldTag */
         foreach ($oldTags as $oldTag) {
             $oldTag->remove();
         }
         foreach ($tagNames as $tagName) {
             $tagName = trim($tagName);
             if (empty($tagName)) {
                 continue;
             }
             /** @var galTag $tag */
             $tag = $this->modx->newObject('galTag');
             $tag->set('item', $this->object->get('id'));
             $tag->set('tag', $tagName);
             $tag->save();
         }
     }
     return parent::afterSave();
 }
コード例 #20
0
 public function afterSave()
 {
     $this->sendNotificationEmail();
     return parent::afterSave();
 }
コード例 #21
0
 public function afterSave()
 {
     $this->modx->cacheManager->refresh();
     return parent::afterSave();
 }
コード例 #22
0
 public function afterSave()
 {
     $this->setAccess();
     return parent::afterSave();
 }
コード例 #23
0
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function afterSave()
 {
     $this->fixParents();
     $this->saveTemplateVariables();
     $this->setResourceGroups();
     $this->checkContextOfChildren();
     $this->fireUnDeleteEvent();
     $this->fireDeleteEvent();
     return parent::afterSave();
 }
コード例 #24
0
 /** {@inheritDoc} */
 public function afterSave()
 {
     $this->modx->SubdomainsFolder->clearCache();
     return parent::afterSave();
 }
コード例 #25
0
ファイル: remove.class.php プロジェクト: jolichter/modxTalks
 /**
  * After save
  * Add comment to cache
  *
  * @return void
  **/
 public function afterSave()
 {
     if ($this->modx->modxtalks->mtCache === true) {
         if (!$this->modx->modxtalks->cacheComment($this->object)) {
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/remove] Error cache the comment with ID ' . $this->object->id);
         }
         if (!$this->modx->modxtalks->cacheConversation($this->theme)) {
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/remove] Error cache the conversation with ID ' . $this->theme->id);
         }
     }
     return parent::afterSave();
 }
コード例 #26
0
 public function afterSave()
 {
     $this->setWidgets();
     return parent::afterSave();
 }
コード例 #27
0
ファイル: update.class.php プロジェクト: raadhuis/modx-basic
 public function afterSave()
 {
     $this->updateContextSettings();
     $this->runOnUpdateEvent();
     return parent::afterSave();
 }
コード例 #28
0
ファイル: update.class.php プロジェクト: lokamaya/Collections
 public function afterSave()
 {
     $global = $this->getProperty('global_template');
     if ($global == true) {
         $this->modx->updateCollection('CollectionTemplate', array('global_template' => false), array('id:!=' => $this->object->id));
     }
     $templates = $this->getProperty('templates');
     $templates = array_filter($templates, function ($var) {
         if ($var == '') {
             return false;
         }
         return true;
     });
     $this->object->setTemplates($templates);
     return parent::afterSave();
 }
コード例 #29
0
ファイル: update.class.php プロジェクト: lokamaya/Collections
 public function afterSave()
 {
     return parent::afterSave();
 }
コード例 #30
0
 public function afterSave()
 {
     $this->modx->cacheManager->refresh(array('default' => array('qsb' => array())));
     return parent::afterSave();
 }