Advertisement
wrsi

i8tPqm1h.php

Apr 19th, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.59 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ POWER X 7 DECODER
  5. * @ Version         :   1.1.4.0
  6. * @ Member          :   vv456
  7. * @ Official site   :   http://www.waraxe.us/forum-userprofile-8669.html
  8. *
  9. */
  10.  
  11.     class widget_monitoring extends HostingWidget {
  12.         private $description = 'Widget to display Nagios monitoring in clientarea. Assign devices to client account in related account section or in Dedicated servers manager';
  13.         private $widgetfullname = 'Monitoring';
  14.  
  15.         function clientFunction($module, $service) {
  16.             $all = $module->loadStatuses(  );
  17.             $dedi = ModuleFactory::singleton(  )->getModuleByFname( 'class.dedimgr.php' );
  18.  
  19.             if (!$module) {
  20.                 return false;
  21.             }
  22.  
  23.             $items = $dedi->getItemsAssignedToAccount( $service['id'], false );
  24.  
  25.             if (!$items) {
  26.                 return false;
  27.             }
  28.  
  29.             $data = array(  );
  30.             foreach ($items as $item) {
  31.                 if ($all[$item['label']]) {
  32.                     $data[$item['label']] = $all[$item['label']];
  33.                     continue;
  34.                 }
  35.             }
  36.  
  37.             return array( 'monitoring.tpl', array( 'monitors' => $data ) );
  38.         }
  39.  
  40.         function controller(&$service, &$module, &$smarty, $params) {
  41.             $return = $this->clientFunction( $module, $service );
  42.  
  43.             if (is_array( $return )) {
  44.                 $this->info['appendtpl'] = $this->getWidgetPath(  ) . DS . $return[0];
  45.                 $widget_details = $smarty->get_template_vars( 'widget' );
  46.  
  47.                 if ($widget_details) {
  48.                     $widget_details['appendtpl'] = $this->info['appendtpl'];
  49.                     $smarty->clear_assign( 'widget' );
  50.                     $smarty->assign( 'widget', $widget_details );
  51.                 }
  52.  
  53.                 $smarty->assign( $return[1] );
  54.                 return null;
  55.             }
  56.  
  57.             $smarty->assign( 'widget_html', $return );
  58.         }
  59.     }
  60.  
  61. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement