本文整理汇总了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;
}
示例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;
}
示例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();
}
}
示例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;
?>
示例5: _initialize
public function _initialize()
{
parent::_initialize();
$this->assign($this->tags_style());
$this->VideoDB = D('Home.Video');
$this->InfoDB = D('Home.Info');
}
示例6: action
/**
* @return void
*/
function action()
{
parent::action();
if ($this->ok) {
Serveur::getInstance()->stopInstance();
}
}
示例7: action
function action()
{
parent::action();
if ($this->ok) {
$this->sendFreeText(Serveur::getInstance());
}
}
示例8: _initialize
public function _initialize()
{
parent::_initialize();
//RBAC 验证接口初始化
Vendor('Common.Tree');
//导入通用树型类
}
示例9: _initialize
public function _initialize()
{
parent::_initialize();
$this->VideoDB = D('Admin.Video');
$this->UserVDB = D('Admin.Userview');
$this->CommDB = D('Admin.Comment');
}
示例10: _initialize
public function _initialize()
{
parent::_initialize();
C('TMPL_FILE_NAME', './views/collection/..');
$this->CModel = D('Admin.CustomCollect');
$this->RModel = D('Admin.ColRun');
}
示例11: _initialize
public function _initialize()
{
parent::_initialize();
C('TMPL_FILE_NAME', './views/tools/..');
//模板目录
$this->DCModel = D('Admin.Datacheck');
}
示例12: _initialize
public function _initialize()
{
parent::_initialize();
$this->SpecDB = D('Admin.Special');
$this->VideoDB = D('Admin.Video');
$this->InfoDB = D('Admin.Info');
}
示例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);
}
示例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');
}
示例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();
}