/** * GetTextMenuItems * This checks the addon is installed & enabled before displaying in the 'tools' menu at the top of the page. * * @param EventData_IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS $data The existing text menu items. This addon puts itself into the tools menu. * * @uses Load * @uses enabled * * @see SendStudio_Functions::GenerateTextMenuLinks * * @return Void The menu is passed in by reference, so it's manipulated directly. * * @uses EventData_IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS */ public static function GetTextMenuItems(EventData_IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS $data) { $user = GetUser(); if (!$user->Admin()) { return; } try { $me = new self(); $me->Load(); } catch (Exception $e) { return; } if (!$me->enabled) { return; } if (!isset($data->data['tools'])) { $data->data['tools'] = array(); } $data->data['tools'][] = array('text' => GetLang('Addon_dbcheck_Menu_Text'), 'link' => $me->admin_url, 'description' => GetLang('Addon_dbcheck_Menu_Description')); unset($me); }
/** * GetTextMenuItems * This checks the addon is installed & enabled before displaying in the 'tools' menu at the top of the page. * * @param EventData_IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS $data The existing text menu items. This addon puts itself into the tools menu. * * @uses Load * @uses enabled * * @see SendStudio_Functions::GenerateTextMenuLinks * * @return Void The menu is passed in by reference, so it's manipulated directly. * * @uses EventData_IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS */ static function GetTextMenuItems(EventData_IEM_SENDSTUDIOFUNCTIONS_GENERATETEXTMENULINKS $data) { $user = GetUser(); if (!$user->Admin()) { return; } try { $me = new self(); $me->Load(); } catch (Exception $e) { return; } if (!$me->enabled) { return; } if (!isset($data->data['tools'])) { $data->data['tools'] = array(); } $data->data['tools'][] = array('text' => GetLang('Addon_updatecheck_Menu_Text'), 'link' => "#\" onclick=\"tb_show('" . LNG_Addon_updatecheck_Check . "', 'index.php?Page=Addons&Addon=updatecheck&Ajax=true&keepThis=true&TB_iframe=true&height=80&width=300', '');", 'description' => GetLang('Addon_updatecheck_Menu_Description')); unset($me); }
/** * LoadSelf * Creates an instance of Addons_surveys * * @return Mixed Returns an object on success, false on failure */ public static function LoadSelf() { try { $me = new self(); $me->Load(); } catch (Exception $e) { return false; } if (!$me->enabled) { return false; } $me->template_system->Assign('AdminUrl', $me->admin_url); return $me; }