当前位置: 首页>>代码示例>>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;未经允许,请勿转载。