本文整理汇总了PHP中AdminAction类的典型用法代码示例。如果您正苦于以下问题:PHP AdminAction类的具体用法?PHP AdminAction怎么用?PHP AdminAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AdminAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addActionNotes
/**
* add action notes
*
* @author youzhao.zxw<[email protected]>
* @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: record
public static function record($type, $logid = 0)
{
if ($type == '') {
return false;
}
if (Yii::app()->user->isGuest) {
return false;
}
$uid = Yii::app()->user->id;
$desc = GroupPowers::getDesc('admin', $type);
if ($desc == '') {
return false;
}
$data = array('uid' => $uid, 'logid' => $logid, 'classify' => $type, 'description' => $desc, 'ip' => ip2long(Yii::app()->request->userHostAddress), 'cTime' => time());
$model = new AdminAction();
$model->attributes = $data;
if ($model->save()) {
return true;
} else {
return false;
}
}
开发者ID:ph7pal,项目名称:wedding,代码行数:22,代码来源:UserAction.php
示例6: _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
示例7: action
/**
* @return void
*/
function action()
{
parent::action();
if ($this->ok) {
Serveur::getInstance()->stopInstance();
}
}
开发者ID:eleparquier,项目名称:buzzer_server,代码行数:10,代码来源:Stop.php
示例8: action
function action()
{
parent::action();
if ($this->ok) {
$this->sendFreeText(Serveur::getInstance());
}
}
开发者ID:eleparquier,项目名称:buzzer_server,代码行数:7,代码来源:Objects.php
示例9: _initialize
public function _initialize()
{
parent::_initialize();
//RBAC 验证接口初始化
Vendor('Common.Tree');
//导入通用树型类
}
开发者ID:jackycgq,项目名称:ThinkPHP_Backend_System,代码行数:7,代码来源:NodeAction.class.php
示例10: _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
示例11: _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
示例12: _initialize
public function _initialize()
{
parent::_initialize();
C('TMPL_FILE_NAME', './views/tools/..');
//模板目录
$this->DCModel = D('Admin.Datacheck');
}
开发者ID:singhvicky,项目名称:pintrest,代码行数:7,代码来源:DatacheckAction.class.php
示例13: _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
示例14: __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
示例15: _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
示例16: 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
示例17: __construct
/**
* 构造方法,初始化
*/
public function __construct() {
parent::__construct();
$this->_name = $this->getParam('cname');
$this->_from = $this->getParam('from');
$this->_to = $this->getParam('to');
$this->_status = $this->getParam('cstatus');
$this->_p = $this->getParam('p') ? intval($this->getParam('p')) : 0;
$this->_openid = $this->getParam('copenid');
$this->_usopenid = $this->getParam('openid');
$this->_order_id = $this->getParam('order_id');
$this->_start_date = $this->getParam('start_date');
$this->_end_date = $this->getParam('end_date');
$this->_status1 = $this->getParam('status1');
$this->_status2 = $this->getParam('status2');
$this->_state = $this->getParam('state');
$this->_sex = $this->getParam('sex');
$this->_grade = $this->getParam('grade');
$this->_channel = $this->getParam('channel');
$this->_create_time = $this->getParam('create_time');
$this->_Model = loadModel('Admin.Card');
$this->_IndexModel = loadModel('Index.Cardto');
$this->_Channel = loadModel('Admin.Channel');
$this->_ParModel = loadModel('Admin.Partner');
$this->_CommonModel = loadModel('Common');
$this->_a = $this->getParam('a');
$this->_m = $this->getParam('m');
$this->assign('a', $this->_a);
$this->assign('m', $this->_m);
$this->_param = array(
'name' => $this->_name,
'openid' => $this->_openid,
'cfrom' => $this->_from,
'cto' => $this->_to,
'state' => $this->_state,
'sex' => $this->_sex,
'grade' => $this->_grade,
'code' => $this->getParam('code'),
'end_time' => $this->getParam('end_time'),
'sub_status' => $this->getParam('sub_status'),
'channel' => $this->getParam('channel'),
'card_type' => $this->getParam('card_type'),
'order_id' => $this->_order_id,
'status1' => $this->_status1,
'status2' => $this->_status2,
'create_time' => $this->_create_time,
);
$this->assign('webdata', $this->_param);
}
开发者ID:neil-chen,项目名称:NeilChen,代码行数:55,代码来源:CardAction.class.php
示例18: validate
function validate()
{
if (!parent::validate()) {
$resources = new GalleryResources();
$resource = $resources->getResource($this->_request->getValue("resourceId"), $this->_blogInfo->getId());
if (!$resource) {
$this->setValidationErrorView(new AdminResourcesListView($this->_blogInfo));
$this->setCommonData();
return false;
}
$this->_view->setValue("resource", $resource);
return false;
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:15,代码来源:adminupdateresourceaction.class.php
示例19: header
function _initialize()
{
parent::_initialize();
//RBAC 验证接口初始化
header("Content-type: text/html;charset=utf-8");
set_time_limit(0);
//不超时
ini_set('memory_limit', '512M');
$this->config = array('path' => C('DB_BACKUP'), 'isCompress' => 0, 'isDownload' => 0);
$this->dbName = C('DB_NAME');
//当前数据库名称
$this->model = new Model();
//$sql = 'set interactive_timeout=24*3600'; //空闲多少秒后 断开链接
//$this->model>execute($sql);
}
开发者ID:jackycgq,项目名称:ThinkPHP_Backend_System,代码行数:15,代码来源:BaksqlAction.class.php
示例20: __construct
public function __construct() {
parent::__construct();
$this->_a = $this->getParam('a');
$this->_m = $this->getParam('m');
$this->_param = $this->getParam();
$this->assign('a', $this->_a);
$this->assign('m', $this->_m);
$this->_p = $this->getParam('p') ? intval($this->getParam('p')) : 0;
$this->_status = $this->getParam('status');
$this->_keyword = $this->getParam('keyword');
$this->_name = $this->getParam('name');
$this->_id = $this->getParam('id');
$this->_Model = loadModel('Admin.Channel');
$webdata = array(
'keyword'=>$this->_keyword,
'status' => $this->_status,
);
$this->assign('webdata', $webdata);
}
开发者ID:neil-chen,项目名称:NeilChen,代码行数:22,代码来源:ChannelAction.class.php
注:本文中的AdminAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论