• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Actions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sendit_subscription

function sendit_subscription()
{
    $sendit = new Actions();
    $sendit->NewSubscriber();
    wp_die();
    // this is required to terminate immediately and return a proper response
}
开发者ID:bulini,项目名称:sendit,代码行数:7,代码来源:markup.php


示例2: TriggerDisplayPage

 public static function TriggerDisplayPage(array $param)
 {
     $action = new Actions();
     if ($action->DisplayPage($param[0])) {
         exit;
     }
 }
开发者ID:rumi55,项目名称:openbulksms,代码行数:7,代码来源:actions.php


示例3: testMergeActions

 public function testMergeActions()
 {
     $contact = $this->contact('testAnyone');
     $action = new Actions();
     $action->actionDescription = "TEST";
     $action->visibility = 1;
     $action->associationType = "contacts";
     $action->associationId = $contact->id;
     $action->save();
     $model = new Contacts();
     foreach ($contact->attributes as $key => $val) {
         if ($key != 'id' && $key != 'nameId') {
             $model->{$key} = $val;
         }
     }
     $model->save();
     $this->assertEquals(0, Yii::app()->db->createCommand()->select('COUNT(*)')->from('x2_actions')->where('associationType = "contacts" AND associationId = :id', array(':id' => $model->id))->queryScalar());
     $this->assertEquals(1, Yii::app()->db->createCommand()->select('COUNT(*)')->from('x2_actions')->where('associationType = "contacts" AND associationId = :id', array(':id' => $contact->id))->queryScalar());
     $mergeData = $model->mergeActions($contact, true);
     $this->assertEquals(1, Yii::app()->db->createCommand()->select('COUNT(*)')->from('x2_actions')->where('associationType = "contacts" AND associationId = :id', array(':id' => $model->id))->queryScalar());
     $this->assertEquals(0, Yii::app()->db->createCommand()->select('COUNT(*)')->from('x2_actions')->where('associationType = "contacts" AND associationId = :id', array(':id' => $contact->id))->queryScalar());
     $model->unmergeActions($contact->id, $mergeData);
     $this->assertEquals(1, Yii::app()->db->createCommand()->select('COUNT(*)')->from('x2_actions')->where('associationType = "contacts" AND associationId = :id', array(':id' => $contact->id))->queryScalar());
     $this->assertEquals(0, Yii::app()->db->createCommand()->select('COUNT(*)')->from('x2_actions')->where('associationType = "contacts" AND associationId = :id', array(':id' => $model->id))->queryScalar());
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:25,代码来源:X2MergeableBehaviorTest.php


示例4: execute

 public function execute(&$params)
 {
     $model = new Actions();
     $model->type = 'note';
     $model->complete = 'Yes';
     $model->associationId = $params['model']->id;
     $model->associationType = $params['model']->module;
     $model->actionDescription = $this->parseOption('comment', $params);
     $model->assignedTo = $this->parseOption('assignedTo', $params);
     $model->completedBy = $this->parseOption('assignedTo', $params);
     if (empty($model->assignedTo) && $params['model']->hasAttribute('assignedTo')) {
         $model->assignedTo = $params['model']->assignedTo;
         $model->completedBy = $params['model']->assignedTo;
     }
     if ($params['model']->hasAttribute('visibility')) {
         $model->visibility = $params['model']->visibility;
     }
     $model->createDate = time();
     $model->completeDate = time();
     if ($model->save()) {
         return array(true, Yii::t('studio', 'View created action: ') . $model->getLink());
     } else {
         $errors = $model->getErrors();
         return array(false, array_shift($errors));
     }
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:26,代码来源:X2FlowRecordComment.php


示例5: renderInput

 public function renderInput(CModel $model, $attribute, array $htmlOptions = array())
 {
     $action = new Actions();
     $action->setAttributes($model->getAttributes(), false);
     $defaultOptions = array('id' => $this->resolveId($attribute));
     $htmlOptions = X2Html::mergeHtmlOptions($defaultOptions, $htmlOptions);
     return preg_replace('/Actions(\\[[^\\]]*\\])/', get_class($this->formModel) . '$1', $action->renderInput($attribute, $htmlOptions));
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:8,代码来源:ActionActiveFormBase.php


示例6: delete

 public function delete($id)
 {
     $db = new Db($this->subgridConfig, $this->statusVariables);
     $fields = $this->subgridConfig->fields();
     $curData = $db->fetchRow($id);
     foreach ($fields as $field) {
         $fieldObject = $this->subgridConfig->fieldObject($field);
         $fieldObject->beforeDelete($id, $curData);
     }
     $sql = "\n        DELETE\n            " . $this->subgridConfig->tableName() . "\n        FROM\n            " . $this->subgridConfig->tableName() . "\n            " . $db->joinQuery() . "\n        WHERE\n            " . $this->subgridConfig->tableName() . ".`" . $this->subgridConfig->idField() . "` = :id\n        ";
     $params = array('id' => $id);
     $callables = $this->subgridConfig->beforeDelete();
     if ($callables) {
         if (is_array($callables) && !is_callable($callables)) {
             foreach ($callables as $callable) {
                 call_user_func($callable, $params['id']);
             }
         } else {
             call_user_func($callables, $params['id']);
         }
     }
     ipDb()->execute($sql, $params);
     if ($this->subgridConfig->isMultilingual()) {
         $sql = "\n            DELETE\n\n            FROM\n                " . $this->subgridConfig->languageTableName() . "\n            WHERE\n                " . $this->subgridConfig->languageTableName() . ".`" . $this->subgridConfig->languageForeignKeyField() . "` = :id\n            ";
         ipDb()->execute($sql, $params);
     }
     $callables = $this->subgridConfig->afterDelete();
     if ($callables) {
         if (is_array($callables) && !is_callable($callables)) {
             foreach ($callables as $callable) {
                 call_user_func($callable, $params['id']);
             }
         } else {
             call_user_func($callables, $params['id']);
         }
     }
     //remove records in child grids
     foreach ($fields as $field) {
         $fieldObject = $this->subgridConfig->fieldObject($field);
         $fieldObject->afterDelete($id, $curData);
         if ($field['type'] == 'Grid') {
             $childStatusVariables = Status::genSubgridVariables($this->statusVariables, $field['gridId'], $id);
             $subActions = new Actions(new Config($field['config']), $childStatusVariables);
             $childConfig = new Config($field['config']);
             $db = new Db($childConfig, $childStatusVariables);
             $where = $db->buildSqlWhere();
             $sql = "\n                    SELECT\n                        `" . $childConfig->idField() . "`\n                    FROM\n                        " . $childConfig->tableName() . "\n                    WHERE\n                        {$where}\n                ";
             $idsToDelete = ipDb()->fetchColumn($sql);
             foreach ($idsToDelete as $idToDelete) {
                 $subActions->delete($idToDelete);
             }
         }
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:54,代码来源:Actions.php


示例7: form

 /**
  * @param array $instance
  * @return string|void
  * @description Widget Backend
  */
 public function form($instance)
 {
     if (isset($instance['title'])) {
         $title = $instance['title'];
     }
     $post_types = get_post_types();
     $objAction = new Actions();
     $data['post_types'] = $post_types;
     $data['title'] = $title;
     $data['obj'] = $this;
     $data['post_type'] = get_post_types();
     echo $objAction->theme('nv_new_posts_widget', $data);
 }
开发者ID:IdDevGroup,项目名称:Identifid-Website,代码行数:18,代码来源:NV_post_widget.php


示例8: testRunAddUser

 /**
  * Makes sure adding a user happens without errors
  * 
  * @link http://issues.thebuggenie.com/thebuggenie/issues/2494
  *
  * @covers thebuggenie\core\modules\configuration\Actions::runAddUser
  * @dataProvider addUserRequestProvider
  */
 public function testRunAddUser($username, $buddyname, $email, $password, $group_id)
 {
     \b2db\Core::resetMocks();
     $scope = $this->getMockBuilder('thebuggenie\\core\\entities\\Scope')->setMethods(array('hasUsersAvailable'))->getMock();
     $scope->method('hasUsersAvailable')->willReturn(true);
     \thebuggenie\core\framework\Context::setScope($scope);
     $request = new \thebuggenie\core\framework\Request();
     $request->setParameter('username', $username);
     $request->setParameter('buddyname', $buddyname);
     $request->setParameter('email', $email);
     $request->setParameter('password', $password);
     $request->setParameter('password_repeat', $password);
     $request->setParameter('group_id', $group_id);
     $usertablestub = $this->getMockBuilder('b2db\\Table')->setMethods(array('isUsernameAvailable'))->getMock();
     $userscopestablestub = $this->getMockBuilder('b2db\\Table')->getMock();
     \b2db\Core::setTableMock('thebuggenie\\core\\entities\\tables\\UserScopes', $userscopestablestub);
     \b2db\Core::setTableMock('thebuggenie\\core\\entities\\User', $usertablestub);
     \b2db\Core::setTableMock('thebuggenie\\core\\entities\\tables\\Users', $usertablestub);
     $usertablestub->method('isUsernameAvailable')->will($this->returnValue(true));
     // Expect action to verify that username is available
     $usertablestub->expects($this->once())->method('isUsernameAvailable')->with($username);
     $userscopestablestub->expects($this->once())->method('countUsers');
     $this->object->runAddUser($request);
     $userobject = \b2db\Core::getTable('thebuggenie\\core\\entities\\tables\\Users')->getLastMockObject();
     // Expect action to set correct user properties
     $this->assertEquals($userobject->getUsername(), $username);
     $this->assertEquals($userobject->getBuddyname(), $buddyname);
     $this->assertEquals($userobject->getRealname(), $username);
     $this->assertEquals($userobject->getEmail(), $email);
 }
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:38,代码来源:ActionsTest.php


示例9: addNormalUser

 private function addNormalUser($aRequest)
 {
     $aUser = array();
     foreach ($this->aUserParams as $sParam) {
         switch ($sParam) {
             case "username":
                 $aUser[$sParam] = strtolower($aRequest[$sParam]);
                 break;
             case "logo":
                 $aUser[$sParam] = Actions::uploadPhotos($aRequest['logo'], 'logo');
                 break;
             default:
                 $aUser[$sParam] = $aRequest[$sParam];
                 break;
         }
     }
     $aUser['date_registered'] = date('Y-m-d h:i:s');
     $aUser['age'] = $aRequest['date_of_birth'];
     //Hashing the password to be saved encrypted
     $aUser['password'] = Hash::make($aUser['password']);
     DB::table('users')->insert($aUser);
     $dIdUser = DB::table('users')->where(array('username' => $aUser['username']))->get(array('id_user'));
     DB::table('user_rating')->insert(array('id_user' => $dIdUser[0]->id_user, 'likes_count' => 0));
     echo "You've registered successfully!";
     return redirect()->intended('/');
 }
开发者ID:4Bara,项目名称:Fooder-Food-ordering-website-,代码行数:26,代码来源:RegisterationController.php


示例10: execute

 public function execute(array $gvSelection)
 {
     $updatedRecordsNum = Actions::changeCompleteState('uncomplete', $gvSelection);
     if ($updatedRecordsNum > 0) {
         self::$successFlashes[] = Yii::t('app', '{updatedRecordsNum} action' . ($updatedRecordsNum === 1 ? '' : 's') . ' uncompleted', array('{updatedRecordsNum}' => $updatedRecordsNum));
     }
     return $updatedRecordsNum;
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:8,代码来源:MassUncompleteAction.php


示例11: processRequest

 /**
  * Processes the specified route
  * @exits
  * @return null
  */
 public function processRequest()
 {
     Actions::trigger("{$this->routeKey}AjaxStart");
     $response = call_user_func($this->action);
     Actions::trigger("{$this->routeKey}AjaxEnd");
     echo json_encode($response);
     die;
 }
开发者ID:aklatzke,项目名称:spartan,代码行数:13,代码来源:AjaxRouter.php


示例12: renderAttribute

 public function renderAttribute($attr, $makeLinks = true, $textOnly = true, $encode = true)
 {
     if ($attr === 'text') {
         $action = Actions::model();
         $action->actionDescription = $this->{$attr};
         return $action->renderAttribute('actionDescription', $makeLinks, $textOnly, $encode);
     }
 }
开发者ID:shayanyi,项目名称:CRM,代码行数:8,代码来源:ActionText.php


示例13: execute

 public function execute(&$params)
 {
     $options = $this->config['options'];
     $action = new Actions();
     $action->subject = $this->parseOption('subject', $params);
     $action->dueDate = $this->parseOption('dueDate', $params);
     $action->actionDescription = $this->parseOption('description', $params);
     $action->priority = $this->parseOption('priority', $params);
     $action->visibility = $this->parseOption('visibility', $params);
     if (isset($params['model'])) {
         $action->assignedTo = $this->parseOption('assignedTo', $params);
     }
     // if(isset($this->config['attributes']))
     // $this->setModelAttributes($action,$this->config['attributes'],$params);
     if ($action->save()) {
         return array(true, Yii::t('studio', "View created action: ") . $action->getLink());
     } else {
         $errors = $action->getErrors();
         return array(false, array_shift($errors));
     }
     // if($this->parseOption('reminder',$params)) {
     // $notif=new Notification;
     // $notif->modelType='Actions';
     // $notif->createdBy=Yii::app()->user->getName();
     // $notif->modelId=$model->id;
     // if($_POST['notificationUsers']=='me'){
     // $notif->user=Yii::app()->user->getName();
     // }else{
     // $notif->user=$model->assignedTo;
     // }
     // $notif->createDate=$model->dueDate-($_POST['notificationTime']*60);
     // $notif->type='action_reminder';
     // $notif->save();
     // if($_POST['notificationUsers']=='both' && Yii::app()->user->getName()!=$model->assignedTo){
     // $notif2=new Notification;
     // $notif2->modelType='Actions';
     // $notif2->createdBy=Yii::app()->user->getName();
     // $notif2->modelId=$model->id;
     // $notif2->user=Yii::app()->user->getName();
     // $notif2->createDate=$model->dueDate-($_POST['notificationTime']*60);
     // $notif2->type='action_reminder';
     // $notif2->save();
     // }
     // }
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:45,代码来源:X2FlowCreateAction.php


示例14: run

 /**
  * Creates the widget. 
  */
 public function run()
 {
     list($assignedToCondition, $params) = Actions::model()->getAssignedToCondition();
     $total = Yii::app()->db->createCommand("\n            select count(*)\n            from x2_actions\n            where {$assignedToCondition} and (type='' or type is null)\n        ")->queryScalar($params);
     $incomplete = Yii::app()->db->createCommand("\n            select count(*)\n            from x2_actions\n            where {$assignedToCondition} and (type='' or type is null) and complete='No'\n        ")->queryScalar($params);
     $overdue = Actions::model()->countByAttributes(array('assignedTo' => Yii::app()->user->getName(), 'complete' => 'No'), 'dueDate < ' . time() . ' AND (type="" OR type IS NULL)');
     $complete = Actions::model()->countByAttributes(array('completedBy' => Yii::app()->user->getName(), 'complete' => 'Yes'), 'type="" OR type IS NULL');
     $this->render('actionMenu', array('total' => $total, 'unfinished' => $incomplete, 'overdue' => $overdue, 'complete' => $complete));
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:12,代码来源:ActionMenu.php


示例15: __construct

 /**
  * @return void
  */
 protected function __construct()
 {
     $this->oHttp = \MailSo\Base\Http::NewInstance();
     $this->oActions = Actions::NewInstance();
     $this->oActions->SetHttp($this->oHttp);
     $this->oTwilio = $this->oActions->GetTwilio();
     \CApi::Plugin()->SetActions($this->oActions);
     //		\MailSo\Config::$FixIconvByMbstring = false;
     \MailSo\Config::$SystemLogger = \CApi::MailSoLogger();
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:13,代码来源:Service.php


示例16: __construct

 /**
  * @return void
  */
 protected function __construct()
 {
     $this->oHttp = \MailSo\Base\Http::NewInstance();
     $this->oActions = Actions::NewInstance();
     $this->oActions->SetHttp($this->oHttp);
     $this->oTwilio = $this->oActions->GetTwilio();
     \CApi::Plugin()->SetActions($this->oActions);
     //		\MailSo\Config::$FixIconvByMbstring = false;
     \MailSo\Config::$SystemLogger = \CApi::MailSoLogger();
     \MailSo\Config::$PreferStartTlsIfAutoDetect = !!\CApi::GetConf('labs.prefer-starttls', true);
 }
开发者ID:zhuomingliang,项目名称:webmail-lite,代码行数:14,代码来源:Service.php


示例17: execute

 public function execute(&$params)
 {
     $action = new Actions();
     $action->associationType = lcfirst(get_class($params['model']));
     $action->associationId = $params['model']->id;
     $action->subject = $this->parseOption('subject', $params);
     $action->actionDescription = $this->parseOption('description', $params);
     if ($params['model']->hasAttribute('assignedTo')) {
         $action->assignedTo = $params['model']->assignedTo;
     }
     if ($params['model']->hasAttribute('priority')) {
         $action->priority = $params['model']->priority;
     }
     if ($params['model']->hasAttribute('visibility')) {
         $action->visibility = $params['model']->visibility;
     }
     if ($action->save()) {
         return array(true, Yii::t('studio', "View created action: ") . $action->getLink());
     } else {
         return array(false, array_shift($action->getErrors()));
     }
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:22,代码来源:X2FlowRecordCreateAction.php


示例18: executePostCommit

 public static function executePostCommit()
 {
     $payload = json_decode($_REQUEST['payload'], true);
     $rawPost = file_get_contents('php://input');
     $secret = trim(file_get_contents($_SERVER['ROOT_DIR'] . '/data/secret/github-secret'));
     Actions::returnErrorIf(!isset($_SERVER['HTTP_X_HUB_SIGNATURE']), "HTTP header 'X-Hub-Signature' is missing.");
     list($algo, $hash) = explode('=', $_SERVER['HTTP_X_HUB_SIGNATURE'], 2) + array('', '');
     Actions::returnErrorIf(!in_array($algo, hash_algos(), TRUE), 'Invalid hash algorithm "' . $algo . '"');
     Actions::returnErrorIf($hash !== hash_hmac($algo, $rawPost, $secret), 'Hash does not match. "' . $secret . '"' . ' algo: ' . $algo . '$');
     if ($payload['ref'] === 'refs/heads/master') {
         $ret = shell_exec('sudo -u lbry ' . $_SERVER['ROOT_DIR'] . '/update.sh  2>&1');
         echo "Successful post commit (aka the script executed, so maybe it is successful):\n";
         echo $ret;
     }
     return [null, []];
 }
开发者ID:teran-mckinney,项目名称:lbry.io,代码行数:16,代码来源:OpsActions.class.php


示例19: run

 public function run()
 {
     $total = Actions::model()->findAllByAttributes(array('assignedTo' => Yii::app()->user->getName(), 'type' => null));
     $total = count($total);
     $temp = Actions::model()->findAllByAttributes(array('assignedTo' => Yii::app()->user->getName(), 'complete' => 'No', 'type' => null));
     $unfinished = count($temp);
     $overdue = 0;
     foreach ($temp as $action) {
         if ($action->dueDate < time()) {
             $overdue++;
         }
     }
     $complete = Actions::model()->findAllByAttributes(array('completedBy' => Yii::app()->user->getName(), 'complete' => 'Yes', 'type' => null));
     $complete = count($complete);
     $this->render('actionMenu', array('total' => $total, 'unfinished' => $unfinished, 'overdue' => $overdue, 'complete' => $complete));
 }
开发者ID:netconstructor,项目名称:X2Engine,代码行数:16,代码来源:ActionMenu.php


示例20: assertActionCreated

 public function assertActionCreated($type, $message = null)
 {
     $action = Actions::model()->findBySql("SELECT * FROM x2_actions WHERE type='{$type}' ORDER BY createDate DESC,id DESC LIMIT 1");
     $this->assertTrue((bool) $action, "Failed asserting that an action was created. {$type}");
     $associatedModel = X2Model::getAssociationModel($action->associationType, $action->associationId);
     // Test that the models are identical:
     $this->eml->targetModel->refresh();
     foreach (array('myModelName', 'id', 'name', 'lastUpdated', 'createDate', 'assignedTo', 'status') as $property) {
         if ($this->eml->targetModel->hasProperty($property) && $associatedModel->hasProperty($property)) {
             $this->assertEquals($this->eml->targetModel->{$property}, $associatedModel->{$property}, "Failed asserting that an action's associated model record was the same, property: {$property}. {$message}");
         }
     }
     // Assert that the username fields are set properly:
     foreach (array('assignedTo', 'completedBy') as $attr) {
         $this->assertEquals('testuser', $action->assignedTo, "Failed asserting that {$attr} was set properly on the action record. {$message}");
     }
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:17,代码来源:InlineEmailTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ActiveRecord类代码示例发布时间:2022-05-23
下一篇:
PHP ActionResponse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap