Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ POWER X 7 DECODER
- * @ Version : 1.1.4.0
- * @ Member : vv456
- * @ Official site : http://www.waraxe.us/forum-userprofile-8669.html
- *
- */
- class widget_monitoring extends HostingWidget {
- private $description = 'Widget to display Nagios monitoring in clientarea. Assign devices to client account in related account section or in Dedicated servers manager';
- private $widgetfullname = 'Monitoring';
- function clientFunction($module, $service) {
- $all = $module->loadStatuses( );
- $dedi = ModuleFactory::singleton( )->getModuleByFname( 'class.dedimgr.php' );
- if (!$module) {
- return false;
- }
- $items = $dedi->getItemsAssignedToAccount( $service['id'], false );
- if (!$items) {
- return false;
- }
- $data = array( );
- foreach ($items as $item) {
- if ($all[$item['label']]) {
- $data[$item['label']] = $all[$item['label']];
- continue;
- }
- }
- return array( 'monitoring.tpl', array( 'monitors' => $data ) );
- }
- function controller(&$service, &$module, &$smarty, $params) {
- $return = $this->clientFunction( $module, $service );
- if (is_array( $return )) {
- $this->info['appendtpl'] = $this->getWidgetPath( ) . DS . $return[0];
- $widget_details = $smarty->get_template_vars( 'widget' );
- if ($widget_details) {
- $widget_details['appendtpl'] = $this->info['appendtpl'];
- $smarty->clear_assign( 'widget' );
- $smarty->assign( 'widget', $widget_details );
- }
- $smarty->assign( $return[1] );
- return null;
- }
- $smarty->assign( 'widget_html', $return );
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement