コード例 #1
0
ファイル: hookTest.php プロジェクト: umjinsun12/dngshin
 public function testAllHooks()
 {
     $hooks = DashboardHooks::genHooks(array());
     return;
     $allhooks = array();
     foreach ($hooks as $page) {
         foreach ($page['entries'] as $item) {
             $allhooks[] = $item['func'];
         }
     }
     foreach ($allhooks as $hookname) {
         $this->assertNotNull(DashboardHooks::runHook($hookname), "Hook {$hookname} returned null");
     }
 }
コード例 #2
0
ファイル: Dashboard.class.php プロジェクト: lidl/dashboard
 public function doDialplanHook(&$ext, $engine, $priority)
 {
     // We're not actually doing any dialplan modifications. This
     // is just a handy place to discover modules that have requested hooks
     // into the status page.
     if (!class_exists('DashboardHooks')) {
         include 'classes/DashboardHooks.class.php';
     }
     $allhooks = DashboardHooks::genHooks($this->getConfig('visualorder'));
     $this->setConfig('allhooks', $allhooks);
     // Also, while we're here, we should check that our cronjob is
     // still there.
     $file = \FreePBX::Config()->get('AMPWEBROOT') . "/admin/modules/dashboard/" . $this->sched;
     $cmd = "[ -x {$file} ] && {$file}";
     // Ensure we instantiate cron with the correct user
     $c = \FreePBX::Cron(\FreePBX::Config()->get('AMPASTERISKWEBUSER'));
     $c->addLine("* * * * * {$cmd}");
 }
コード例 #3
0
 public function doDialplanHook(&$ext, $engine, $priority)
 {
     // We're not actually doing any dialplan modifications. This
     // is just a handy place to discover modules that have requested hooks
     // into the status page.
     if (!class_exists('DashboardHooks')) {
         include 'classes/DashboardHooks.class.php';
     }
     $allhooks = DashboardHooks::genHooks($this->getConfig('visualorder'));
     $this->setConfig('allhooks', $allhooks);
     // Also, while we're here, we should check that our cronjob is
     // still there.
     $file = \FreePBX::Config()->get('AMPWEBROOT') . "/admin/modules/dashboard/" . $this->sched;
     $cmd = "[ -x {$file} ] && {$file}";
     // Some HA machines had TWO schedulers running. Whoops. Manually
     // remove ALL of them. (To be removed in 13)
     $all = \FreePBX::Cron()->getAll();
     foreach ($all as $line) {
         if (strpos($line, "dashboard/scheduler.php") !== false) {
             \FreePBX::Cron()->remove($line);
         }
     }
     $this->Cron->addLine("* * * * * {$cmd}");
 }
コード例 #4
0
<?php

// vim: set ai ts=4 sw=4 ft=phtml:
// New Dashboard
//	License for all code of this FreePBX module can be found in the license file inside the module directory
//	Copyright 2013 Schmooze Com Inc.
//
if (!class_exists('DashboardHooks')) {
    include 'classes/DashboardHooks.class.php';
}
$allhooks = DashboardHooks::genHooks(FreePBX::Dashboard()->getConfig('visualorder'));
FreePBX::Dashboard()->setConfig('allhooks', $allhooks);
show_view(__DIR__ . '/views/main.php', array("brand" => FREEPBX::Config()->get('DASHBOARD_FREEPBX_BRAND')));