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


PHP FreePBX::Hooks方法代码示例

本文整理汇总了PHP中FreePBX::Hooks方法的典型用法代码示例。如果您正苦于以下问题:PHP FreePBX::Hooks方法的具体用法?PHP FreePBX::Hooks怎么用?PHP FreePBX::Hooks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FreePBX的用法示例。


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

示例1: getSections

 public function getSections()
 {
     $sections = array();
     $users = \FreePBX::Core()->listUsers(true);
     $ret = array();
     $ret['title'] = _("Users");
     $featurecodes = \featurecodes_getAllFeaturesDetailed();
     $ret['textdesc'] = _('User');
     $ret['numdesc'] = _('Extension');
     $ret['items'] = array();
     foreach ($users as $user) {
         $ret['items'][] = array($user[1], $user[0]);
     }
     $sections[] = $ret;
     $hookdata = \FreePBX::Hooks()->processHooks();
     foreach ($hookdata as $key => $value) {
         $sections[] = $value;
     }
     $html .= '<div class="row holder">';
     $html .= '<div class="col-sm-12">';
     foreach ($sections as $k => $v) {
         $html .= '<div class="row">';
         $html .= '<h3>' . $v['title'] . '</h3>';
         $html .= '<ul class="list-group">';
         foreach ($v['items'] as $item) {
             $html .= '	<li class="list-group-item col-sm-6"><b>' . $item[1] . '</b> - ' . $item[0] . '</li>';
         }
         $html .= '</ul>';
         $html .= '<br/>';
         $html .= '	</div>';
     }
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:35,代码来源:Printextensions.class.php

示例2: asteriskInfoHooks

 /**
  * [asteriskInfoHooks Hooking in to Asterisk Info Module]
  * @return [array]
  * 		'mode' => "Mode",
  * 		'title' => "title",
  * 		'commands' => array('subtitle' => 'command1', 'subtitle' => 'command2')
  */
 public function asteriskInfoHooks()
 {
     $data = \FreePBX::Hooks()->processHooks();
     return $data;
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:12,代码来源:Asteriskinfo.class.php

示例3: extIgnoreList

 public function extIgnoreList()
 {
     $numbers = array();
     $hooks = \FreePBX::Hooks()->processHooks();
     foreach ($hooks as $key => $value) {
         if (is_array($value)) {
             $numbers = array_merge($numbers, $value);
         }
     }
     return $numbers;
 }
开发者ID:lidl,项目名称:dashboard,代码行数:11,代码来源:Dashboard.class.php

示例4: flush

                 }
             default:
                 // just so we don't send an <hr> and flush()
                 $didsomething = false;
         }
         if ($didsomething) {
             if (!empty($change_tracks)) {
                 $modulef->set_tracks($change_tracks);
             }
             @ob_flush();
             flush();
         }
     }
     echo _("Updating Hooks...");
     try {
         \FreePBX::Hooks()->updateBMOHooks();
     } catch (\Exception $e) {
     }
     echo _("Done") . "<br />";
     echo "</div>";
     echo "<hr /><br />";
     if ($quietmode) {
         echo '<a class="btn" href="#" onclick="parent.close_module_actions(true);" >' . _("Return") . '</a>';
     }
     break;
 case 'confirm':
     if (is_array($trackaction)) {
         ksort($trackaction);
     }
     if (is_array($moduleaction)) {
         ksort($moduleaction);
开发者ID:nriendeau,项目名称:framework,代码行数:31,代码来源:page.modules.php

示例5: getSummary

 public function getSummary()
 {
     $svcs = array("asterisk" => _("Asterisk"), "mysql" => _("MySQL"), "apache" => _("Web Server"));
     $sysinfo = \FreePBX::create()->Dashboard->getSysInfo();
     $final = array();
     $i = 0;
     foreach (array_keys($svcs) as $svc) {
         if (!method_exists($this, "check{$svc}")) {
             $final[$i]['type'] = 'unknown';
             $final[$i]['tooltip'] = "Function check{$svc} doesn't exist!";
         } else {
             $func = "check{$svc}";
             $final[$i] = $this->{$func}($sysinfo);
         }
         $final[$i]['title'] = $svcs[$svc];
         $i++;
     }
     $t = \FreePBX::Hooks()->processHooks($sysinfo);
     $f = $final;
     foreach ($t as $d) {
         foreach ($d as $d1) {
             $order = isset($d1['order']) ? $d1['order'] : count($f);
             if ($order == 0) {
                 array_unshift($f, $d1);
                 continue;
             }
             $t1 = array_slice($f, 0, $order, true);
             $t2 = array_slice($f, $order, count($f) - 1, true);
             $f = array_merge($t1, array($d1), $t2);
         }
     }
     return $f;
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:33,代码来源:Overview.class.php

示例6: updateHooks

 private function updateHooks()
 {
     $this->write(_("Updating Hooks..."));
     try {
         \FreePBX::Hooks()->updateBMOHooks();
     } catch (\Exception $e) {
     }
     $this->writeln(_("Done"));
 }
开发者ID:powerpbx,项目名称:framework,代码行数:9,代码来源:Moduleadmin.class.php

示例7: postAsteriskHooks

 private function postAsteriskHooks($output, $execute = true)
 {
     if (!$execute) {
         return \FreePBX::Hooks()->returnHooks();
     }
     \FreePBX::Hooks()->processHooks($output);
     return;
 }
开发者ID:lidl,项目名称:framework,代码行数:8,代码来源:Stop.class.php

示例8: pageHook

 public function pageHook($request)
 {
     return \FreePBX::Hooks()->processHooks($request);
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:4,代码来源:Ivr.class.php

示例9: delTimeGroup

 public function delTimeGroup($id)
 {
     $sql = "delete from timegroups_details where timegroupid = :id";
     $stmt = $this->db->prepare($sql);
     $ret1 = $stmt->execute(array(':id' => $id));
     $sql = "delete from timegroups_groups where id = :id";
     $stmt = $this->db->prepare($sql);
     $ret2 = $stmt->execute(array(':id' => $id));
     needreload();
     \FreePBX::Hooks()->processHooks($id);
     return $ret1 && $ret2;
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:12,代码来源:Timeconditions.class.php

示例10: fwcChownFiles

 private function fwcChownFiles()
 {
     $modules = \FreePBX::Hooks()->processHooks();
     return $modules;
 }
开发者ID:sokrat,项目名称:freepbx-framework,代码行数:5,代码来源:Chown.class.php

示例11: hookForm

 public function hookForm()
 {
     $module_hook = \moduleHook::create();
     $mods = \FreePBX::Hooks()->processHooks();
     $sections = array();
     foreach ($mods as $mod => $contents) {
         if (empty($contents)) {
             continue;
         }
         if (is_array($contents)) {
             foreach ($contents as $content) {
                 if (!isset($sections[$content['rawname']])) {
                     $sections[$content['rawname']] = array("title" => $content['title'], "rawname" => $content['rawname'], "content" => $content['content']);
                 } else {
                     $sections[$content['rawname']]['content'] .= $content['content'];
                 }
             }
         } else {
             if (!isset($sections[$mod])) {
                 $sections[$mod] = array("title" => ucfirst(strtolower($mod)), "rawname" => $mod, "content" => $contents);
             } else {
                 $sections[$mod]['content'] .= $contents;
             }
         }
     }
     $hookcontent = '';
     foreach ($sections as $data) {
         $hookcontent .= '<div class="section-title" data-for="paginghook' . $data['rawname'] . '"><h3><i class="fa fa-minus"></i> ' . $data['title'] . '</h3></div>';
         $hookcontent .= '<div class="section" data-id="paginghook' . $data['rawname'] . '">';
         $hookcontent .= $data['content'];
         $hookcontent .= '</div>';
     }
     return array("hookContent" => $hookcontent, "oldHooks" => $module_hook->hookHtml);
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:34,代码来源:Paging.class.php

示例12: externalMessages

 public function externalMessages()
 {
     $ret = array('pre' => array(), 'post' => array(), 'cancel' => false);
     $hooks = \FreePBX::Hooks()->processHooks();
     foreach ($hooks as $hook) {
         if (is_array($hook)) {
             if (isset($hook['pre'])) {
                 if (is_array($hook['pre'])) {
                     foreach ($hook['pre'] as $o) {
                         $ret['pre'][] = $o;
                     }
                 } else {
                     $ret['pre'][] = $hook['pre'];
                 }
             }
             if (isset($hook['post'])) {
                 if (is_array($hook['post'])) {
                     foreach ($hook['post'] as $o) {
                         $ret['post'][] = $o;
                     }
                 } else {
                     $ret['post'][] = $hook['post'];
                 }
             }
             if (isset($hook['cancel'])) {
                 $ret['cancel'] = true;
             }
         }
     }
     return $ret;
 }
开发者ID:lidl,项目名称:framework,代码行数:31,代码来源:Motd.class.php


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