当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminAction类代码示例

本文整理汇总了PHP中AdminAction的典型用法代码示例。如果您正苦于以下问题:PHP AdminAction类的具体用法?PHP AdminAction怎么用?PHP AdminAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AdminAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addActionNotes

 /**
  * add action notes
  *
  * @author                                  youzhao.zxw<swustnjtu@gmail.com>
  * @param   string  $tableName              target table name
  * @param   string  $action                 edit action
  * @param   array   $newRecordAttributes    new record attributes
  * @param   array   $oldRecordAttributs     old record attributes
  * @return  array                           add action notes result
  */
 public static function addActionNotes($tableName, $action, $newRecordAttributes, $oldRecordAttributs)
 {
     $infoAction = new AdminAction();
     $infoAction->action_type = $action;
     $infoAction->target_table = $tableName;
     $infoAction->target_id = $newRecordAttributes['id'];
     if (!$infoAction->save()) {
         $resultInfo['status'] = CommonService::$ApiResult['FAIL'];
         $resultInfo['detail'] = $infoAction->getErrors();
         return $resultInfo;
     } else {
         if (!empty($oldRecordAttributs)) {
             $diffAttributeArr = self::compareRecord($oldRecordAttributs, $newRecordAttributes);
             foreach ($diffAttributeArr as $diffInfo) {
                 $actionHistory = new AdminHistory();
                 $actionHistory->action_field = $diffInfo[0];
                 $actionHistory->adminaction_id = $infoAction->id;
                 $actionHistory->old_value = $diffInfo[1];
                 $actionHistory->new_value = $diffInfo[2];
                 if (!$actionHistory->save()) {
                     $resultInfo['status'] = CommonService::$ApiResult['FAIL'];
                     $resultInfo['detail'] = $actionHistory->getErrors();
                     return $resultInfo;
                 }
             }
         }
     }
     $resultInfo['status'] = CommonService::$ApiResult['SUCCESS'];
     $resultInfo['detail'] = array('id' => $infoAction->id);
     return $resultInfo;
 }
开发者ID:mjrao,项目名称:BugFree,代码行数:41,代码来源:AdminActionService.php

示例2: add

 /**
  * 新增一条管理员操作记录
  * @param type $attr
  * @return boolean
  */
 public static function add($attr)
 {
     if (empty($attr)) {
         return false;
     }
     $modelAA = new AdminAction();
     $modelAA->attributes = $attr;
     if ($modelAA->save()) {
         return true;
     }
     return false;
 }
开发者ID:ph7pal,项目名称:wedding,代码行数:17,代码来源:AdminAction.php

示例3: _initialize

 protected function _initialize()
 {
     if (!self::$init) {
         self::$init = true;
         //标记已经进入初始化,否则new AdminAction将陷入死递归
         define('TH_VERSION', '1.1.3');
         //所有action初始化代码放在这个大括号内部,否则下面的AdminAction实例化时又将重复执行一次初始化代码,注意不同功能代码可能需要一定的顺序
         ///////自定义扩展区///////////////
         ///////cookie初始化区域///////////
         if (C('COOKIE_PATH') == '/') {
             C('COOKIE_PATH', __ROOT__);
         }
         if (C('COOKIE_PREFIX') == '') {
             $prefix = trim(__ROOT__ . '_', '/\\');
             C('COOKIE_PREFIX', $prefix);
         }
         $listapp = new AdminAction();
         $list = $listapp->listAPP();
         if ($list == false) {
             $this->assign('noapp', "<span>还没有添加任何项目,或者applist.xml文件读取异常</span>");
             cookie('config_path', '');
             cookie('base_dir', '');
             cookie('app_name', '暂无');
             cookie('app_index', '暂无');
             cookie('app_url', '');
         } else {
             $this->assign('listapp', $list);
             if (cookie('switch') != 'on' && (!cookie('config_path') || !cookie('base_dir'))) {
                 $default = $list[0];
                 //cookie设置
                 cookie('config_path', CheckConfig::dirModifier($default['path']) . 'Conf/config.php');
                 cookie('base_dir', CheckConfig::dirModifier($default['path']));
                 cookie('app_name', $default['name']);
                 cookie('app_index', $default['index']);
                 cookie('app_url', $default['url']);
             }
         }
         cookie('think_path', CheckConfig::dirModifier(THINK_PATH));
         cookie('tp_helper', CheckConfig::dirModifier(APP_PATH));
         cookie('version', THINK_VERSION);
         ///////include模板变量分配区域/////////
         $this->include_assign();
     }
 }
开发者ID:sdgdsffdsfff,项目名称:TPhelper,代码行数:44,代码来源:CommonAction.class.php

示例4: sanitize

        $ctr = 1;
    }
    if ($ctr == "") {
        if (isset($_POST['isFreeShipping'])) {
            $isFreeShipping = 1;
        } else {
            $isFreeShipping = 0;
        }
        $_POST = sanitize($_POST);
        $coupons = $_POST;
        settype($coupons, 'object');
        $coupons->isFreeShipping = $isFreeShipping;
        Coupon::updateCoupon($coupons);
        $success = "Copun Code Successfully Saved!";
        $updates = 'Add new coupon code content';
        AdminAction::addAdminAction($_SESSION['admin_name'], $updates);
    }
}
?>
<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">  
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo $ROOT_URL;
?>
_admin/_assets/css/core3.css" /> 
  <link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo $ROOT_URL;
?>
开发者ID:romackdnr,项目名称:dnrpiggyments,代码行数:31,代码来源:edit.php

示例5: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->assign($this->tags_style());
     $this->VideoDB = D('Home.Video');
     $this->InfoDB = D('Home.Info');
 }
开发者ID:skygunner,项目名称:ekucms,代码行数:7,代码来源:HtmlAction.class.php

示例6: action

 /**
  * @return void
  */
 function action()
 {
     parent::action();
     if ($this->ok) {
         Serveur::getInstance()->stopInstance();
     }
 }
开发者ID:eleparquier,项目名称:buzzer_server,代码行数:10,代码来源:Stop.php

示例7: action

 function action()
 {
     parent::action();
     if ($this->ok) {
         $this->sendFreeText(Serveur::getInstance());
     }
 }
开发者ID:eleparquier,项目名称:buzzer_server,代码行数:7,代码来源:Objects.php

示例8: _initialize

 public function _initialize()
 {
     parent::_initialize();
     //RBAC 验证接口初始化
     Vendor('Common.Tree');
     //导入通用树型类
 }
开发者ID:jackycgq,项目名称:ThinkPHP_Backend_System,代码行数:7,代码来源:NodeAction.class.php

示例9: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->VideoDB = D('Admin.Video');
     $this->UserVDB = D('Admin.Userview');
     $this->CommDB = D('Admin.Comment');
 }
开发者ID:singhvicky,项目名称:pintrest,代码行数:7,代码来源:VideoAction.class.php

示例10: _initialize

 public function _initialize()
 {
     parent::_initialize();
     C('TMPL_FILE_NAME', './views/collection/..');
     $this->CModel = D('Admin.CustomCollect');
     $this->RModel = D('Admin.ColRun');
 }
开发者ID:skygunner,项目名称:ekucms,代码行数:7,代码来源:CustomcollectAction.class.php

示例11: _initialize

 public function _initialize()
 {
     parent::_initialize();
     C('TMPL_FILE_NAME', './views/tools/..');
     //模板目录
     $this->DCModel = D('Admin.Datacheck');
 }
开发者ID:singhvicky,项目名称:pintrest,代码行数:7,代码来源:DatacheckAction.class.php

示例12: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->SpecDB = D('Admin.Special');
     $this->VideoDB = D('Admin.Video');
     $this->InfoDB = D('Admin.Info');
 }
开发者ID:singhvicky,项目名称:pintrest,代码行数:7,代码来源:SpecialAction.class.php

示例13: __construct

    public function __construct(){
        parent::__construct();

        $this->_a = $this->getParam('a');
        $this->_m = $this->getParam('m');
        $this->assign('a', $this->_a);
        $this->assign('m', $this->_m);
        $this->_p = $this->getParam('p')?$this->getParam('p'):1;
        $this->assign('p', $this->_p);
        
        $this->_model = loadModel('Admin.Rebate');
        
        $this->_keyword = $this->getParam('keyword');
        $this->_createtime = $this->getParam('createtime');
        $this->_status = $this->getParam('status');
        $this->_gendar = $this->getParam('gendar');
        $this->_level = $this->getParam('level');
        $this->_channel = $this->getParam('channel'); 
        $this->_id = $this->getParam('id');
        $this->_openid = $this->getParam('openid');
        $this->_end_date = $this->getParam('end_date');
        
        $this->_param = array(
            'keyword'=>$this->_keyword ,
            'createtime'=>$this->_createtime,
            'end_date'=>$this->_end_date,
            'status' => $this->_status,
            'gendar' => $this->_gendar,
            'level'=>$this->_level,
            'channel'=>$this->_channel
        );
        $this->assign('webdata', $this->_param);
        
       
    }
开发者ID:neil-chen,项目名称:NeilChen,代码行数:35,代码来源:RebateAction.class.php

示例14: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->UserDB = D('Admin.User');
     $this->UserVDB = D('Admin.Userview');
     $this->GbookDB = D('Admin.Gbook');
     $this->CommDB = D('Admin.Comment');
 }
开发者ID:singhvicky,项目名称:pintrest,代码行数:8,代码来源:UserAction.class.php

示例15: validate

 /**
  * Check that the parameter is correct.
  */
 function validate()
 {
     // let's make sure that the "page" parameter has a sane value
     // and that it is not below 0
     $val = new IntegerValidator();
     $this->_page = $this->_request->getValue("page");
     if (!$val->validate($this->_page) || $this->_page < 0) {
         $this->_page = 1;
     }
     // run the real validation stuff...
     return parent::validate();
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:15,代码来源:adminpoststatsaction.class.php


注:本文中的AdminAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。