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


PHP trigger_event函数代码示例

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


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

示例1: orph_callback_search_wanted

 function orph_callback_search_wanted(&$data, $base, $file, $type, $lvl, $opts)
 {
     if ($type == 'd') {
         return true;
         // recurse all directories, but we don't store namespaces
     }
     if (!preg_match("/.*\\.txt\$/", $file)) {
         // Ignore everything but TXT
         return true;
     }
     // search the body of the file for links
     // dae mod
     //	orph_Check_InternalLinks(&$data,$base,$file,$type,$lvl,$opts);
     $this->orph_Check_InternalLinks($data, $base, $file, $type, $lvl, $opts);
     $eventData = array('data' => &$data, 'file' => $file);
     trigger_event('PLUGIN_ORPHANS_WANTED_PROCESS_PAGE', $eventData);
     // get id of this file
     $id = pathID($file);
     //check ACL
     if (auth_quickaclcheck($id) < AUTH_READ) {
         return false;
     }
     // try to avoid making duplicate entries for forms and pages
     $item =& $data["{$id}"];
     if (isset($item)) {
         // This item already has a member in the array
         // Note that the file search found it
         $item['exists'] = true;
     } else {
         // Create a new entry
         $data["{$id}"] = array('exists' => true, 'links' => 0);
     }
     return true;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:34,代码来源:helper.php

示例2: addApproval

 function addApproval()
 {
     global $USERINFO;
     global $ID;
     global $INFO;
     if (!$INFO['exists']) {
         msg($this->getLang('cannot approve a non-existing revision'), -1);
         return;
     }
     $approvalRevision = $this->helper->getRevision();
     $approvals = $this->helper->getApprovals();
     if (!isset($approvals[$approvalRevision])) {
         $approvals[$approvalRevision] = array();
     }
     $approvals[$approvalRevision][$INFO['client']] = array($INFO['client'], $_SERVER['REMOTE_USER'], $USERINFO['mail'], time());
     $success = p_set_metadata($ID, array('approval' => $approvals), true, true);
     if ($success) {
         msg($this->getLang('version approved'), 1);
         $data = array();
         $data['rev'] = $approvalRevision;
         $data['id'] = $ID;
         $data['approver'] = $_SERVER['REMOTE_USER'];
         $data['approver_info'] = $USERINFO;
         if ($this->getConf('send_mail_on_approve') && $this->helper->isRevisionApproved($approvalRevision)) {
             /** @var action_plugin_publish_mail $mail */
             $mail = plugin_load('action', 'publish_mail');
             $mail->send_approve_mail();
         }
         trigger_event('PLUGIN_PUBLISH_APPROVE', $data);
     } else {
         msg($this->getLang('cannot approve error'), -1);
     }
     send_redirect(wl($ID, array('rev' => $this->helper->getRevision()), true, '&'));
 }
开发者ID:hefanbo,项目名称:dokuwiki-plugin-publish,代码行数:34,代码来源:approve.php

示例3: process

 public function process()
 {
     $assignment_id = $this->input->post('assignment_id');
     $assignment = $this->assignment_model->get($assignment_id);
     $unit = $this->unit_model->get($assignment->unit_id);
     $order = (object) $this->order_model->get_values($assignment->order_id);
     $form_data = $this->get_form_data($this->input->post('unit_type_id'), $assignment_id, $this->input->post(), true);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => $order_type, 'stage' => 'unit_serial', 'param' => $assignment_id, 'module' => 'miniant'));
     foreach ($form_data['required'] as $field => $description) {
         $this->form_validation->set_rules($field, $description, 'trim|required');
     }
     $success = $this->form_validation->run();
     if (!$success) {
         add_message('The form could not be submitted. Please check the errors below', 'danger');
         return $this->index($assignment_id);
     }
     $unit_id = $this->unit_model->merge_if_serial_exists($form_data['fields'], $assignment_id);
     if ($unit_id != $assignment->unit_id) {
         add_message('The serial number you entered matches an existing unit. Please review the details below and answer the questions at the bottom of the form', 'warning');
     }
     trigger_event('unit_serial_entered', 'assignment', $assignment_id, false, 'miniant');
     redirect($this->workflow_manager->get_next_url());
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:25,代码来源:Unit_serial.php

示例4: process

 public function process($assignment_id)
 {
     $assignment = (object) $this->assignment_model->get_values($assignment_id);
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => 'installation', 'stage' => 'installation_checklist', 'param' => $assignment_id, 'module' => 'miniant'));
     trigger_event('installation_tasks_completed', 'assignment', $assignment_id, false, 'miniant');
     redirect($this->workflow_manager->get_next_url());
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:8,代码来源:Installation_checklist.php

示例5: p_close

 function p_close()
 {
     $this->doc .= $this->_getLink() . '</p>' . DOKU_LF;
     if (preg_match('/<p[^>]*>\\s*<!--PN-->.*?(?:<\\/p>)$/', $this->doc)) {
         $this->PNitemCount--;
     } else {
         $eventdata = array('doc' => &$this->doc, 'pid' => $this->_getID());
         trigger_event('PLUGIN_PURPLENUMBERS_P_CLOSED', $eventdata);
     }
 }
开发者ID:selfthinker,项目名称:dokuwiki_plugin_purplenumbers,代码行数:10,代码来源:renderer.php

示例6: create

 public function create()
 {
     $client_id = $this->input->post('client_id');
     $address_id = $this->input->post('address_id');
     $call_date = human_to_unix($this->input->post('call_date'));
     $params = compact('client_id', 'call_date', 'address_id');
     $order_id = $this->order_model->add($params);
     trigger_event('create_order', 'order', $order_id, false, 'miniant');
     send_json_data(array('order_id' => $order_id));
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:10,代码来源:Order_ajax.php

示例7: useCache

 /**
  * public method to determine whether the cache can be used
  *
  * to assist in centralisation of event triggering and calculation of cache statistics,
  * don't override this function override _useCache()
  *
  * @param  array   $depends   array of cache dependencies, support dependecies:
  *                            'age'   => max age of the cache in seconds
  *                            'files' => cache must be younger than mtime of each file
  *                                       (nb. dependency passes if file doesn't exist)
  *
  * @return bool    true if cache can be used, false otherwise
  */
 public function useCache($depends = array())
 {
     $this->depends = $depends;
     $this->_addDependencies();
     if ($this->_event) {
         return $this->_stats(trigger_event($this->_event, $this, array($this, '_useCache')));
     } else {
         return $this->_stats($this->_useCache());
     }
 }
开发者ID:kevinlovesing,项目名称:dokuwiki,代码行数:23,代码来源:cache.php

示例8: set_task_status

 public function set_task_status()
 {
     $status = $this->input->post('status');
     $task_id = $this->input->post('repair_task_id');
     $task = $this->repair_task_model->get($task_id);
     $assignment = $this->assignment_model->get_from_cache($task->assignment_id);
     $this->repair_task_model->update_task($status, $task_id);
     if (!$status) {
         trigger_event('repair_tasks_completed', 'order', $assignment->order_id, true, 'miniant');
     }
     send_json_message('The task was successfully updated');
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:12,代码来源:Repair_checklist.php

示例9: process

 public function process($assignment_id)
 {
     // TODO Make sure all required tasks were completed
     $assignment = $this->assignment_model->get_values($assignment_id);
     $order = (object) $this->order_model->get_values($assignment->order_id);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => $order_type, 'stage' => 'postjob_checklist', 'param' => $assignment_id, 'module' => 'miniant'));
     $next_page_url = $this->workflow_manager->get_next_url();
     trigger_event('post-job_complete', 'order', $order->id, false, 'miniant');
     redirect($next_page_url);
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:12,代码来源:Postjob_checklist.php

示例10: process_edit

 public function process_edit()
 {
     $technician_time_hours = $this->input->post('technician_time_hours') * 60 * 60;
     $technician_time_minutes = $this->input->post('technician_time_minutes') * 60;
     $technician_time = $technician_time_hours + $technician_time_minutes;
     $invoice_tenancy_id = $this->input->post('invoice_tenancy_id');
     $order_id = $this->input->post('order_id');
     $abbreviations = $this->input->post('abbreviations');
     $this->invoice_tenancy_model->update_abbreviations($invoice_tenancy_id, $abbreviations);
     $this->invoice_tenancy_model->edit($invoice_tenancy_id, compact('technician_time'));
     trigger_event('reviewed', 'invoice_tenancies', $invoice_tenancy_id, false, 'miniant');
     add_message('Invoice updated');
     redirect(base_url() . 'miniant/orders/documents/index/html/' . $order_id);
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:14,代码来源:Documents.php

示例11: process

 public function process()
 {
     $assignment_id = $this->input->post('assignment_id');
     $order_id = $this->input->post('order_id');
     $assignment = $this->assignment_model->get($assignment_id);
     $order = $this->order_model->get($order_id);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => $order_type, 'stage' => 'office_notes', 'param' => $assignment_id, 'module' => 'miniant'));
     if (user_has_role($this->session->userdata('user_id'), 'Technician')) {
         trigger_event('office_notes_sighted', 'order', $order_id, false, 'miniant');
     }
     redirect($this->workflow_manager->get_next_url());
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:14,代码来源:Office_notes.php

示例12: process

 public function process($assignment_id)
 {
     $assignment = $this->assignment_model->get_values($assignment_id);
     $order = (object) $this->order_model->get_values($assignment->order_id);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     if (!$this->files_exist_in_upload_folder($assignment_id) && in_array($order_type, array('Breakdown'))) {
         add_message('Please upload at least one photo', 'warning');
         return $this->index($assignment_id);
     }
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => $order_type, 'stage' => 'unit_photos', 'param' => $assignment_id, 'extra_param' => $type, 'module' => 'miniant'));
     add_message('Equipment photos were successfully recorded');
     trigger_event('unit_photos_uploaded', 'assignment', $assignment_id, false, 'miniant');
     redirect($this->workflow_manager->get_next_url());
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:15,代码来源:Unit_photos.php

示例13: _finalize

 function _finalize()
 {
     $this->CallWriter->finalise();
     if ($this->status['section']) {
         $last_call = end($this->calls);
         array_push($this->calls, array('section_close', array(), $last_call[2]));
     }
     if ($this->rewriteBlocks) {
         $B = new Doku_Handler_Block();
         $this->calls = $B->process($this->calls);
     }
     trigger_event('PARSER_HANDLER_DONE', $this);
     array_unshift($this->calls, array('document_start', array(), 0));
     $last_call = end($this->calls);
     array_push($this->calls, array('document_end', array(), $last_call[2]));
 }
开发者ID:Kirill,项目名称:dokuwiki,代码行数:16,代码来源:handler.php

示例14: get_next_url

 public function get_next_url()
 {
     $next_url = parent::get_next_url();
     $ci = get_instance();
     if (strstr($next_url, 'job_list')) {
         $assignment_id = $this->current_param;
         $assignment = $ci->assignment_model->get($assignment_id);
         $technician_id = $ci->session->userdata('user_id');
         $order_technician = $ci->order_technician_model->get(array('order_id' => $assignment->order_id, 'technician_id' => $technician_id), true);
         $is_technician = user_has_role($ci->session->userdata('user_id'), 'Technician');
         if ($is_technician) {
             trigger_event('is_complete', 'order_technician', $order_technician->id, false, 'miniant');
         }
     }
     return $next_url;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:16,代码来源:Miniant_Workflow_manager.php

示例15: idx_get_version

/**
 * Version of the indexer taking into consideration the external tokenizer.
 * The indexer is only compatible with data written by the same version.
 *
 * @triggers INDEXER_VERSION_GET
 * Plugins that modify what gets indexed should hook this event and
 * add their version info to the event data like so:
 *     $data[$plugin_name] = $plugin_version;
 *
 * @author Tom N Harris <tnharris@whoopdedo.org>
 * @author Michael Hamann <michael@content-space.de>
 */
function idx_get_version()
{
    static $indexer_version = null;
    if ($indexer_version == null) {
        $version = INDEXER_VERSION;
        // DokuWiki version is included for the convenience of plugins
        $data = array('dokuwiki' => $version);
        trigger_event('INDEXER_VERSION_GET', $data, null, false);
        unset($data['dokuwiki']);
        // this needs to be first
        ksort($data);
        foreach ($data as $plugin => $vers) {
            $version .= '+' . $plugin . '=' . $vers;
        }
        $indexer_version = $version;
    }
    return $indexer_version;
}
开发者ID:neutrinog,项目名称:Door43,代码行数:30,代码来源:indexer.php


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