當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Base_module_model::on_after_save方法代碼示例

本文整理匯總了PHP中Base_module_model::on_after_save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Base_module_model::on_after_save方法的具體用法?PHP Base_module_model::on_after_save怎麽用?PHP Base_module_model::on_after_save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Base_module_model的用法示例。


在下文中一共展示了Base_module_model::on_after_save方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: on_after_post

 public function on_after_post($values)
 {
     $values = parent::on_after_save($values);
     $data = $this->normalized_save_data;
     if (isset($data['other_perms']) and is_array($data['other_perms']) and !empty($values['name'])) {
         $module = $values['name'];
         $CI =& get_instance();
         $other_perms = $CI->fuel->permissions->create_simple_module_permissions($module, $data['other_perms']);
         $users = $CI->input->post('users');
         if (!empty($users)) {
             // get the IDS of the other perms
             $perm_ids = array();
             foreach ($other_perms as $op) {
                 $perm = $this->find_one_array(array('name' => $op['name']));
                 $perm_ids[] = $perm['id'];
             }
             // now associate the other users to those perms
             $CI->load->module_model(FUEL_FOLDER, 'fuel_users_model');
             foreach ($users as $user_id) {
                 $user = $CI->fuel_users_model->find_by_key($user_id);
                 if (isset($user->id)) {
                     $model = $user->get_permissions(TRUE);
                     $user_perms = $model->find_all_array_assoc('id');
                     $user_perm_ids = array_keys($user_perms);
                     $user->permissions = array_merge($user_perm_ids, $perm_ids);
                     $user->save();
                 }
             }
         }
     }
     return $values;
 }
開發者ID:huayuxian,項目名稱:FUEL-CMS,代碼行數:32,代碼來源:fuel_permissions_model.php

示例2: on_after_save

 /**
  * Model hook executed right after saving
  *
  * @access	public
  * @param	array The values that were just saved
  * @return	array Returns the values that were saved
  */
 public function on_after_save($values)
 {
     parent::on_after_save($values);
     $CI =& get_instance();
     $user = $CI->fuel->auth->user_data();
     // reset session information...
     if (isset($values['id'], $user['id']) and $values['id'] == $user['id']) {
         // if (!empty($values['password']))
         // {
         // 	$CI->fuel->auth->set_user_data('password', $values['password']);
         // }
         if (!empty($values['language'])) {
             $CI->fuel->auth->set_user_data('language', $values['language']);
         }
     }
     if (!empty($this->normalized_save_data['new_password'])) {
         $this->fuel->logs->write(lang('auth_log_cms_pass_reset', $values['user_name'], $this->input->ip_address()), 'debug');
     }
     $this->_send_email($values['id']);
     return $values;
 }
開發者ID:kbjohnson90,項目名稱:FUEL-CMS,代碼行數:28,代碼來源:fuel_users_model.php

示例3: on_after_save

 public function on_after_save($values)
 {
     parent::on_after_save($values);
     return $values;
 }
開發者ID:aaronharding,項目名稱:FUEL-CMS-Forms-Module,代碼行數:5,代碼來源:form_entries_model.php

示例4: array

 function on_after_save($values)
 {
     // if no category is selected, then we set it to the Uncategorized
     $saved_data = $this->normalized_save_data;
     if (empty($saved_data['categories'])) {
         $this->normalized_save_data['categories'] = array(1);
     }
     $values = parent::on_after_save($values);
     $CI =& get_instance();
     // remove cache
     $CI->fuel->blog->remove_cache();
     return $values;
 }
開發者ID:pwhsueh,項目名稱:voting,代碼行數:13,代碼來源:blog_posts_model.php


注:本文中的Base_module_model::on_after_save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。