Inheritance: extends singleton, implements ArrayAccess
Exemple #1
0
 /**
  * Construct
  *
  * @param registry $registry
  * @param int $currency_id Current currency_id id
  */
 public function __construct($registry, $currency_id)
 {
     $this->_db = $registry->get('db');
     try {
         $statement = $this->_db->prepare('SELECT * FROM `currency`');
         $statement->execute();
     } catch (PDOException $e) {
         if ($this->db->inTransaction()) {
             $this->db->rollBack();
         }
         trigger_error($e->getMessage());
     }
     if ($statement->rowCount()) {
         foreach ($statement->fetchAll() as $currency) {
             $this->_currencies[$currency->currency_id] = array('currency_id' => $currency->currency_id, 'code' => $currency->code, 'rate' => $currency->rate, 'symbol' => $currency->symbol, 'name' => $currency->name);
             if ($currency->currency_id == $currency_id) {
                 $this->_currency_id = $currency->currency_id;
                 $this->_currency_code = $currency->code;
                 $this->_currency_rate = $currency->rate;
                 $this->_currency_name = $currency->name;
                 $this->_currency_symbol = $currency->symbol;
             }
         }
     }
 }
Exemple #2
0
 protected function registerFunction()
 {
     parent::registerFunction();
     $this->serviceClass->registerFunction('crmdata', array('session' => 'xsd:string', 'email' => 'xsd:string'), array('return' => 'xsd:string'));
     $this->serviceClass->registerFunction('syncticket', array('session' => 'xsd:string', 'data' => 'xsd:string'), array('return' => 'xsd:string'));
     $this->serviceClass->registerFunction('version', array(), array('return' => 'xsd:string'));
 }
Exemple #3
0
 public function __construct()
 {
     parent::__construct();
     $this->registry = registry::getInstance();
     $this->html = html::getInstance();
     $this->plugin = plugin::getInstance();
 }
 /**
  * executes all controllers and compile the final HTML Document.
  *
  * @return string finalHTML
  */
 public function execute()
 {
     if (HANDHELD) {
         header('Pragma: public');
         header("Expires: " . gmdate("Y-m-d\\TH:i:s\\Z", time() + 60 * 30));
         header('Cache-Control: no-store, must-revalidate, post-check=0, pre-check=0, no-transform, max-age=1800');
     }
     foreach ($this->mountPoints as $column => $controllers) {
         ${$column} = "";
         foreach ($controllers as $c) {
             ${$column} .= $c->execute();
         }
     }
     $pageTitle = $this->title;
     $pageDescription = $this->description;
     $bodyClass = $this->bodyClass;
     foreach (registry::getInstance() as $k => $v) {
         ${$k} = $v;
     }
     isset($contentType) ? http_response::content($contentType) : http_response::content(CONTENT_TYPE);
     ob_start();
     require $this->file;
     // output is gzipped and minified (NO; PROBLEMS WITH CODE BLOCKS!).
     // ob_postprocess(trim(preg_replace('/\s+/', ' ', ob_get_clean())));
     echo ob_get_clean();
 }
 public function add()
 {
     if (isset($_POST['save_user_btn'])) {
         $row = [];
         if ($_GET['id']) {
             $row['id'] = $_GET['id'];
         } else {
             $row['create_date'] = date('Y-m-d H:i:s');
         }
         $row['email'] = $_POST['email'];
         $row['user_name'] = $_POST['user_name'];
         $row['user_surname'] = $_POST['user_surname'];
         $row['user_group_id'] = $_POST['user_group_id'];
         if ($_POST['user_password']) {
             $row['user_password'] = md5($_POST['user_password']);
         }
         $this->model('backend_users')->insert($row);
         if ($_POST['user_password']) {
             $this->logOut();
             $this->auth(registry::get('user')['email'], md5($_POST['user_password']));
             registry::remove('user');
             $this->checkAuth();
         }
         header('Location: ' . SITE_DIR . 'users/');
         exit;
     }
     $this->render('user_groups', $this->model('user_groups')->getAll());
     if ($_GET['id']) {
         $this->render('user', $this->model('backend_users')->getById($_GET['id']));
     }
     $this->view('users' . DS . 'add');
 }
 public function output()
 {
     include_once $this->root_path . 'portal/twitter/twittermodule.class.php';
     $rss_feeds = registry::register('twittermodule');
     $this->header = $this->user->lang('twitter');
     return $rss_feeds->output_left;
 }
Exemple #7
0
 public function __construct()
 {
     $registry = registry::getInstance();
     $path = empty($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == "/" ? $registry->config['default_controller'] : ltrim(strtolower($_SERVER['REQUEST_URI']), "/");
     if (strstr($path, "/")) {
         $arr = explode('/', $path);
         $page = $arr[0];
         $action = empty($arr[1]) ? 'index' : $arr[1];
     } else {
         $page = $path;
         $action = "index";
     }
     $file = 'application/controllers/controller.' . $page . '.php';
     if (file_exists($file)) {
         $class = strtolower($page);
         if (class_exists($class)) {
             $controller = new $class();
             if (!is_callable(array($controller, $action))) {
                 $this->handle404();
             } else {
                 $controller->{$action}();
             }
         } else {
             $this->handle404();
         }
     } else {
         $this->handle404();
     }
 }
Exemple #8
0
 /**
  * Session Constructor
  *
  * The constructor runs the session routines automatically
  * whenever the class is instantiated.
  */
 public function __construct()
 {
     // Set the super object to a local variable for use throughout the class
     $this->registry =& registry::instance();
     // Do we need use cookie? If so, load the input library
     $this->registry->load->library('input');
     // Do we need encryption? If so, load the encryption library
     if ($this->session_encrypt_cookie == true) {
         $this->registry->load->library('encrypt');
     }
     // Set the "now" time.  Can either be GMT or server time, based on the
     // config prefs.  We use this to set the "last activity" time
     $this->now = $this->_get_time();
     // Set the session length. If the session expiration is
     // set to zero we'll set the expiration two years from now.
     if ($this->session_expiration == 0) {
         $this->session_expiration = 60 * 60 * 24 * 365 * 2;
     }
     // Set the cookie name
     $this->session_cookie_name = $this->cookie_prefix . $this->session_cookie_name;
     // Run the Session routine. If a session doesn't exist we'll
     // create a new one.  If it does, we'll update it.
     if (!$this->session_read()) {
         $this->session_create();
     } else {
         $this->session_update();
     }
 }
 /**
  * Constructor
  * Initialize all informations for installing/uninstalling plugin
  */
 public function __construct()
 {
     parent::__construct();
     $this->add_data(array('name' => 'Awards', 'code' => 'awards', 'path' => 'awards', 'contact' => '*****@*****.**', 'template_path' => 'plugins/awards/templates/', 'icon' => 'fa fa-list-alt', 'version' => $this->version, 'author' => $this->copyright, 'description' => $this->user->lang('awards_short_desc'), 'long_description' => $this->user->lang('awards_long_desc'), 'homepage' => 'https://eqdkp-plus.eu/', 'manuallink' => 'https://eqdkp-plus.eu/wiki/Plugin:_Awards', 'plus_version' => '2.0', 'build' => $this->build));
     $this->add_dependency(array('plus_version' => '2.0'));
     // -- Register our permissions ------------------------
     // permissions: 'a'=admins, 'u'=user
     // ('a'/'u', Permission-Name, Enable? 'Y'/'N', Language string, array of user-group-ids that should have this permission)
     // Groups: 1 = Guests, 2 = Super-Admin, 3 = Admin, 4 = Member
     $this->add_permission('u', 'view', 'Y', $this->user->lang('view'), array(2, 3, 4));
     $this->add_permission('a', 'add', 'N', $this->user->lang('add'), array(2, 3));
     $this->add_permission('a', 'manage', 'N', $this->user->lang('manage'), array(2, 3));
     // -- PDH Modules -------------------------------------
     $this->add_pdh_read_module('awards_achievements');
     $this->add_pdh_read_module('awards_assignments');
     $this->add_pdh_read_module('awards_library');
     $this->add_pdh_write_module('awards_achievements');
     $this->add_pdh_write_module('awards_assignments');
     // -- Classes -----------------------------------------
     registry::add_class('awards_plugin', 'plugins/awards/classes/', 'awards');
     // -- Routing -----------------------------------------
     $this->routing->addRoute('Awards', 'awards', 'plugins/awards/pageobjects');
     // -- Hooks -------------------------------------------
     $this->add_hook('portal', 'awards_portal_hook', 'portal');
     $this->add_hook('userprofile_customtabs', 'awards_userprofile_customtabs_hook', 'userprofile_customtabs');
     // -- Menu --------------------------------------------
     $this->add_menu('admin', $this->gen_admin_menu());
     $this->add_menu('main', $this->gen_main_menu());
     $this->add_menu('settings', $this->usersettings());
 }
Exemple #10
0
 /**
  * @author Damien Lasserre <*****@*****.**>
  * @param $_config_file
  */
 public function __construct($_config_file)
 {
     /** @var string $log_path */
     $log_path = APPLICATION_PATH . '/tmp/application.log';
     if (file_exists($_config_file)) {
         /** @var array $_attributes */
         $_attributes = parse_ini_file($_config_file, true);
         /** @var definition\config[] $_config */
         $_config = new \stdClass();
         foreach ($_attributes as $_env => $_parameters) {
             if ($_env == APPLICATION_ENV) {
                 foreach ($_parameters as $_parameter => $value) {
                     /** @var definition\config _parameter */
                     $_config->{$_parameter} = new definition\config();
                     $_config->{$_parameter}->_setName($_parameter)->_setValue($value)->_activate();
                 }
             }
         }
         if (isset($_config->log_path) and $_config->log_path->isActivated()) {
             $log_path = $_config->log_path;
         }
         if (is_file($log_path)) {
             defined('APPLICATION_PATH_LOG') || define('APPLICATION_PATH_LOG', $log_path);
         }
         $this->_configuration = $_config;
         /** Set in registry */
         registry::getInstance()->add('config', $this);
     }
 }
 public function __construct($controller, $action)
 {
     if (isset($_POST['log_out_btn'])) {
         $this->logOut();
         header('Location: ' . SITE_DIR);
         exit;
     }
     if (isset($_POST['login_btn'])) {
         if ($this->auth($_POST['email'], md5($_POST['password']), $_POST['remember'])) {
             header('Location: ' . SITE_DIR);
         } else {
             $this->render('error', true);
         }
     }
     registry::set('log', array());
     $this->controller_name = $controller;
     $this->check_auth = $this->checkAuth();
     if ($this->check_auth) {
         //            $this->sidebar();
     }
     $this->action_name = $action . ($this->check_auth ? '_na' : '');
     $config = [];
     foreach ($this->model('asanatt_system_config')->getAll() as $v) {
         $config[$v['config_key']] = $v['config_value'];
     }
     registry::set('config', $config);
 }
 public function output()
 {
     $strModule = $this->config('module');
     if (!strlen($strModule)) {
         $strModule = "ts3";
     }
     $arrSettingsArray = $this->get_settings('fetch_new');
     $arrOptions = array();
     foreach ($arrSettingsArray as $key => $value) {
         $arrOptions[$key] = $this->config($key);
     }
     $out = "";
     if ($strModule == "ts3") {
         include_once $this->root_path . 'portal/voice/modules/teamspeak3/teamspeak3_voice.class.php';
         $ts3 = registry::register('teamspeak3_voice', array($arrOptions));
         $out = $ts3->output();
     } elseif ($strModule == "ventrilo") {
         include_once $this->root_path . 'portal/voice/modules/ventrilo/ventrilo_voice.class.php';
         $ventrilo = new ventrilo_voice($arrOptions);
         $out = $ventrilo->output();
     } elseif ($strModule == "mumble") {
         include_once $this->root_path . 'portal/voice/modules/mumble/mumble_voice.class.php';
         $mumble = registry::register('mumble_voice', array($arrOptions));
         $out = $mumble->output();
     }
     $this->header = $this->user->lang($strModule);
     return $out;
 }
 public function unites_ajax()
 {
     switch ($_REQUEST['action']) {
         case "save_taste":
             $taste = $_POST['taste'];
             $taste['id'] = $this->model('tastes')->insert($taste);
             $taste['status'] = 1;
             echo json_encode($taste);
             exit;
             break;
         case "save_unit":
             $rows = [];
             $date = date('Y-m-d H:i:s');
             for ($i = 0; $i < $_POST['quantity']; $i++) {
                 $rows[$i] = $_POST['unit'];
                 $rows[$i]['create_date'] = $date;
                 $rows[$i]['creator'] = registry::get('user')['id'];
             }
             $this->model('stock_units')->insertRows($rows);
             echo json_encode(array('status' => 1));
             exit;
             break;
         case "get_unites":
             $params = [];
             $params['table'] = 'stock_units u';
             $params['join']['tastes'] = array('as' => 't', 'on' => 't.id = u.taste_id', 'left' => true);
             $params['join']['products'] = array('as' => 'p', 'on' => 'p.id = u.product_id');
             $params['select'] = array('p.product_name', 'IF(t.taste_name, t.taste_name, " - ")', 'IF(t.expiration_date, t.expiration_date, " - ")');
             exit;
             break;
     }
 }
Exemple #14
0
 function __construct()
 {
     parent::__construct();
     $this->registry = registry::getInstance();
     $this->addAction('index_init', 'init');
     $this->addAction('index_load', 'addToolbar');
 }
Exemple #15
0
 public function __construct($cache_type = false)
 {
     $this->global_prefix = $this->config->get('prefix', 'pdc') ? $this->config->get('prefix', 'pdc') : $this->table_prefix;
     $this->cache_folder = $this->pfh->FolderPath('data', 'cache');
     if ($this->config->get('dttl', 'pdc')) {
         $this->default_ttl = $this->config->get('dttl', 'pdc');
     }
     //make sure the folder is protected by a .htaccess file
     $this->pfh->secure_folder('data', 'cache');
     //read expiry date tab
     $result = @file_get_contents($this->cache_folder . 'expiry_dates.php');
     if ($result !== false) {
         $this->expiry_dates = unserialize($result);
     } else {
         $this->save_expiry_dates();
     }
     //create our cache object
     if (!$cache_type) {
         $cache_type = $this->config->get('mode', 'pdc') ? 'cache_' . $this->config->get('mode', 'pdc') : 'cache_none';
     }
     require_once $this->root_path . 'core/cache/cache.iface.php';
     require_once $this->root_path . 'core/cache/' . $cache_type . '.class.php';
     $this->cache = registry::register($cache_type);
     //pdl fun
     if (!$this->pdl->type_known("pdc_query")) {
         $this->pdl->register_type("pdc_query", null, array($this, 'pdl_html_format_pdc_query'), array(2, 3, 4));
     }
 }
 public function display()
 {
     $strTag = utf8_strtolower($this->patharray[0]);
     if (!strlen($strTag)) {
         redirect($this->controller_path_plain . $this->SID);
     }
     $arrArticleIDs = $this->pdh->get('articles', 'articles_for_tag', array($strTag));
     $arrArticleIDs = $this->pdh->sort($arrArticleIDs, 'articles', 'date', 'desc');
     $intStart = $this->in->get('start', 0);
     $arrLimitedIDs = $this->pdh->limit($arrArticleIDs, $intStart, $this->user->data['user_nlimit']);
     //Articles to template
     foreach ($arrLimitedIDs as $intArticleID) {
         $userlink = '<a href="' . $this->routing->build('user', $this->pdh->geth('articles', 'user_id', array($intArticleID)), 'u' . $this->pdh->get('articles', 'user_id', array($intArticleID))) . '">' . $this->pdh->geth('articles', 'user_id', array($intArticleID)) . '</a>';
         //Content dependet from list_type
         //1 = until readmore
         //2 = Headlines only
         //3 = only first 600 characters
         $strText = $this->pdh->get('articles', 'text', array($intArticleID));
         $arrContent = preg_split('#<hr(.*)id="system-readmore"(.*)\\/>#iU', xhtml_entity_decode($strText));
         $strText = $this->bbcode->parse_shorttags($arrContent[0]);
         $strPath = $this->pdh->get('articles', 'path', array($intArticleID));
         $intCategoryID = $this->pdh->get('articles', 'category', array($intArticleID));
         //Replace Image Gallery
         $arrGalleryObjects = array();
         preg_match_all('#<p(.*)class="system-gallery"(.*) data-sort="(.*)" data-folder="(.*)">(.*)</p>#iU', $strText, $arrGalleryObjects, PREG_PATTERN_ORDER);
         if (count($arrGalleryObjects[0])) {
             include_once $this->root_path . 'core/gallery.class.php';
             foreach ($arrGalleryObjects[4] as $key => $val) {
                 $objGallery = registry::register('gallery');
                 $strGalleryContent = $objGallery->create($val, (int) $arrGalleryObjects[3][$key], $this->server_path . $strPath, 1);
                 $strText = str_replace($arrGalleryObjects[0][$key], $strGalleryContent, $strText);
             }
         }
         //Replace Raidloot
         $arrRaidlootObjects = array();
         preg_match_all('#<p(.*)class="system-raidloot"(.*) data-id="(.*)"(.*) data-chars="(.*)">(.*)</p>#iU', $strText, $arrRaidlootObjects, PREG_PATTERN_ORDER);
         if (count($arrRaidlootObjects[0])) {
             include_once $this->root_path . 'core/gallery.class.php';
             foreach ($arrRaidlootObjects[3] as $key => $val) {
                 $objGallery = registry::register('gallery');
                 $withChars = $arrRaidlootObjects[5][$key] == "true" ? true : false;
                 $strRaidlootContent = $objGallery->raidloot((int) $val, $withChars);
                 $strText = str_replace($arrRaidlootObjects[0][$key], $strRaidlootContent, $strText);
             }
         }
         $this->comments->SetVars(array('attach_id' => $intArticleID, 'page' => 'articles'));
         $intCommentsCount = $this->comments->Count();
         //Tags
         $arrTags = $this->pdh->get('articles', 'tags', array($intArticleID));
         $this->tpl->assign_block_vars('article_row', array('ARTICLE_CONTENT' => $strText, 'ARTICLE_TITLE' => $this->pdh->get('articles', 'title', array($intArticleID)), 'ARTICLE_SUBMITTED' => sprintf($this->user->lang('news_submitter'), $userlink, $this->time->user_date($this->pdh->get('articles', 'date', array($intArticleID)), false, true)), 'ARTICLE_DATE' => $this->time->user_date($this->pdh->get('articles', 'date', array($intArticleID)), false, false, true), 'ARTICLE_PATH' => $this->controller_path . $this->pdh->get('articles', 'path', array($intArticleID)), 'ARTICLE_SOCIAL_BUTTONS' => $arrCategory['social_share_buttons'] ? $this->social->createSocialButtons($this->env->link . $this->pdh->get('articles', 'path', array($intArticleID)), strip_tags($this->pdh->get('articles', 'title', array($intArticleID)))) : '', 'PERMALINK' => $this->pdh->get('articles', 'permalink', array($intArticleID)), 'S_TAGS' => count($arrTags) && $arrTags[0] != "" ? true : false, 'ARTICLE_CUTTED_CONTENT' => truncate($strText, 600, '...', false, true), 'S_READMORE' => isset($arrContent[1]) ? true : false, 'COMMENTS_COUNTER' => $intCommentsCount == 1 ? $intCommentsCount . ' ' . $this->user->lang('comment') : $intCommentsCount . ' ' . $this->user->lang('comments'), 'S_COMMENTS' => $this->pdh->get('articles', 'comments', array($intArticleID)) ? true : false, 'S_FEATURED' => $this->pdh->get('articles', 'featured', array($intArticleID))));
         if (count($arrTags) && $arrTags[0] != "") {
             foreach ($arrTags as $tag) {
                 $this->tpl->assign_block_vars('article_row.tag_row', array('TAG' => $tag, 'U_TAG' => $this->routing->build('tag', $tag)));
             }
         }
     }
     $this->tpl->assign_vars(array('TAG' => sanitize($strTag), 'PAGINATION' => generate_pagination($this->strPath . $this->SID, count($arrArticleIDs), $this->user->data['user_nlimit'], $intStart, 'start')));
     $this->tpl->add_meta('<link rel="canonical" href="' . $this->env->link . $this->routing->build('tag', $tag, false, false, true) . '" />');
     $this->core->set_vars(array('page_title' => $this->user->lang("tag") . ': ' . sanitize($strTag), 'template_file' => 'tag.html', 'display' => true));
 }
 public function get_filled_output()
 {
     $this->dbtype = registry::get_const('dbtype');
     $this->dbhost = registry::get_const('dbhost');
     $this->dbname = registry::get_const('dbname');
     $this->dbuser = registry::get_const('dbuser');
     return $this->get_output();
 }
 public function parse_input()
 {
     //Delete yourself
     $pfh = registry::register('file_handler', array('installer'));
     $pfh->Delete($this->root_path . 'supporttool/');
     header('Location: ' . $this->root_path . 'index.php');
     exit;
 }
 public function output()
 {
     include_once $this->root_path . 'portal/mmo_news/mmo_news_rss.class.php';
     $class = registry::register('mmo_news_rss', array($this->position, $this->id));
     $output = $class->output_left;
     $this->header = sanitize($class->header);
     return $output;
 }
 public function __construct($mountPoints = false)
 {
     $this->file = VIEW . '/layout.phtml';
     $reg =& registry::getInstance();
     $mountPoints = $mountPoints !== false ? $mountPoints : $reg['columns'];
     foreach ($mountPoints as $wrap) {
         $this->mountPoints[$wrap] = array();
     }
 }
Exemple #21
0
 /**
  * class constructor
  *
  * @access	public
  */
 public function __construct()
 {
     // set the class instance
     registry::instance($this);
     // instantiate loader engine
     $this->load = new AppLoader();
     // instantiate viewer engine
     $this->view = new AppViewer();
 }
 protected function render($key, $value)
 {
     $common_vars = registry::get('common_vars');
     if (!$common_vars) {
         $common_vars = [];
     }
     $common_vars[$key] = $value;
     registry::set('common_vars', $common_vars);
 }
Exemple #23
0
 public function __construct()
 {
     $this->registry = registry::getInstance();
     $this->path = $this->registry["path"];
     $this->html = html::getInstance();
     $this->session = $this->registry["session"];
     $this->cookie = $this->registry["cookie"];
     $this->ajax = new ajax();
     $this->l10n = l10n::getInstance();
 }
Exemple #24
0
 /**
  * This method registers all the complex types
  *
  */
 protected function registerTypes()
 {
     parent::registerTypes();
     $this->serviceClass->registerType('link_list2', 'complexType', 'struct', 'all', '', array('link_list' => array('name' => 'link_list', 'type' => 'tns:link_list')));
     $this->serviceClass->registerType('link_lists', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:link_list2[]')), 'tns:link_list2');
     $this->serviceClass->registerType('link_array_list', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:link_value2[]')), 'tns:link_value2');
     $this->serviceClass->registerType('link_value2', 'complexType', 'struct', 'all', '', array('link_value' => array('name' => 'link_value', 'type' => 'tns:link_value')));
     $this->serviceClass->registerType('field_list2', 'complexType', 'struct', 'all', '', array("field_list" => array('name' => 'field_list', 'type' => 'tns:field_list')));
     $this->serviceClass->registerType('entry_list2', 'complexType', 'struct', 'all', '', array("entry_list" => array('name' => 'entry_list', 'type' => 'tns:entry_list')));
 }
 public function __construct()
 {
     parent::__construct();
     $this->pdh->register_read_module($this->this_game, $this->path . 'pdh/read/' . $this->this_game);
     // Meine Klasse und mein benötigtes PDH Modul
     registry::add_class('wow_arsenal', $this->path . 'arsenal/', 'arsenal');
     $this->pdh->register_read_module('arsenal_character', $this->path . 'pdh/read/arsenal_character');
     $this->pdh->register_write_module('arsenal_character', $this->path . 'pdh/write/arsenal_character');
     $this->importers = array('char_import' => 'charimporter.php', 'char_update' => 'charimporter.php', 'guild_import' => 'guildimporter.php', 'guild_imp_rsn' => false, 'import_data_cache' => false);
 }
 static function getModels()
 {
     // registry preparation
     $registry = registry::getInstance();
     // validate input
     $modelId = http_request::getString('model');
     $entityId = http_request::getString('entityId');
     // get all models
     $registry['models'] = new model_dir(ROOT . '/model');
 }
    function WoWMacroexport($raid_id, $raid_groups = 0)
    {
        $attendees = registry::register('plus_datahandler')->get('calendar_raids_attendees', 'attendees', array($raid_id));
        $guests = registry::register('plus_datahandler')->get('calendar_raids_guests', 'members', array($raid_id));
        $a_json = array();
        foreach ($attendees as $id_attendees => $d_attendees) {
            $char_server = registry::register('plus_datahandler')->get('member', 'profile_field', array($id_attendees, 'servername'));
            $servername = $char_server != registry::register('config')->get('servername') ? $char_server : false;
            $a_json[] = array('name' => unsanitize(registry::register('plus_datahandler')->get('member', 'name', array($id_attendees))), 'status' => $d_attendees['signup_status'], 'guest' => false, 'group' => $d_attendees['raidgroup'], 'realm' => $servername);
        }
        foreach ($guests as $guestsdata) {
            $a_json[] = array('name' => unsanitize($guestsdata['name']), 'status' => false, 'guest' => true, 'group' => $guestsdata['raidgroup'], 'realm' => false);
        }
        $json = json_encode($a_json);
        unset($a_json);
        registry::register('template')->add_js('
			genOutput()
			$("input[type=\'checkbox\'], #raidgroup").change(function (){
				genOutput()
			});
		', "docready");
        registry::register('template')->add_js('
		function genOutput(){
			var attendee_data = ' . $json . ';
			output = "";

			cb_guests		= ($("#cb_guests").attr("checked")) ? true : false;
			cb_confirmed	= ($("#cb_confirmed").attr("checked")) ? true : false;
			cb_signedin		= ($("#cb_signedin").attr("checked")) ? true : false;
			cb_backup		= ($("#cb_backup").attr("checked")) ? true : false;

			$.each(attendee_data, function(i, item) {
				if((cb_guests && item.guest == true) || (cb_confirmed && !item.guest && item.status == 0) || (cb_signedin && item.status == 1) || (cb_backup && item.status == 3)){
					if($("#raidgroup").length == 0 || $("#raidgroup").val() == "0" || (item.group > 0 && item.group == $("#raidgroup").val())){
						realmdata	 = (item.realm) ? "-" + item.realm : "";
						output		+= "/inv " + item.name + realmdata + "\\n";
					}
				}
			});
			$("#attendeeout").html(output);
		}
			');
        if (is_array($raid_groups)) {
            $text = "<dt><label>" . registry::fetch('user')->lang('raidevent_export_raidgroup') . "</label></dt>\n\t\t\t\t\t\t\t<dd>\n\t\t\t\t\t\t\t\t" . new hdropdown('raidgroup', array('options' => $raid_groups, 'value' => 0, 'id' => 'raidgroup')) . "\n\t\t\t\t\t\t\t</dd>\n\t\t\t\t\t\t</dl><dl>";
        }
        $text .= "<input type='checkbox' checked='checked' name='confirmed' id='cb_confirmed' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 0));
        $text .= "<input type='checkbox' checked='checked' name='guests' id='cb_guests' value='true'> " . registry::fetch('user')->lang('raidevent_raid_guests');
        $text .= "<input type='checkbox' checked='checked' name='signedin' id='cb_signedin' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 1));
        $text .= "<input type='checkbox' name='backup' id='cb_backup' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 3));
        $text .= "<br/>";
        $text .= "<textarea name='group" . rand() . "' id='attendeeout' cols='60' rows='10' onfocus='this.select()' readonly='readonly'>";
        $text .= "</textarea>";
        $text .= '<br/>' . registry::fetch('user')->lang('rp_copypaste_ig') . "</b>";
        return $text;
    }
Exemple #28
0
 function __construct()
 {
     parent::__construct();
     $this->registry = registry::getInstance();
     if (!defined('GESHI_VERSION')) {
         require_once Absolute_Path . "app/plugins/geshi/GeSHi.php";
     }
     $this->addAction('index_post_content', 'source_code_beautifier');
     $this->addAction('admin_comments_content', 'comment_source_code_beautifier');
     $this->addAction('index_comment_content', 'comment_source_code_beautifier');
 }
Exemple #29
0
 /**
  * This method registers all the complex types
  *
  */
 protected function registerTypes()
 {
     parent::registerTypes();
     $this->serviceClass->registerType('md5_results', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:string[]')), 'xsd:string');
     $this->serviceClass->registerType('module_names', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:string[]')), 'xsd:string');
     $this->serviceClass->registerType('upcoming_activities_list', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:upcoming_activity_entry[]')), 'tns:upcoming_activity_entry');
     $this->serviceClass->registerType('upcoming_activity_entry', 'complexType', 'struct', 'all', '', array("id" => array('name' => "id", 'type' => 'xsd:string'), "module" => array('name' => "module", 'type' => 'xsd:string'), "date_due" => array('name' => "date_due", 'type' => 'xsd:string'), "summary" => array('name' => "summary", 'type' => 'xsd:string')));
     $this->serviceClass->registerType('last_viewed_list', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:last_viewed_entry[]')), 'tns:last_viewed_entry');
     $this->serviceClass->registerType('last_viewed_entry', 'complexType', 'struct', 'all', '', array("id" => array('name' => "id", 'type' => 'xsd:string'), "item_id" => array('name' => "item_id", 'type' => 'xsd:string'), "item_summary" => array('name' => "item_summary", 'type' => 'xsd:string'), "module_name" => array('name' => "module_name", 'type' => 'xsd:string'), "monitor_id" => array('name' => "monitor_id", 'type' => 'xsd:string'), "date_modified" => array('name' => "date_modified", 'type' => 'xsd:string')));
     $this->serviceClass->registerType('field', 'complexType', 'struct', 'all', '', array('name' => array('name' => 'name', 'type' => 'xsd:string'), 'type' => array('name' => 'type', 'type' => 'xsd:string'), 'group' => array('name' => 'group', 'type' => 'xsd:string'), 'label' => array('name' => 'label', 'type' => 'xsd:string'), 'required' => array('name' => 'required', 'type' => 'xsd:int'), 'options' => array('name' => 'options', 'type' => 'tns:name_value_list'), 'default_value' => array('name' => 'name', 'type' => 'xsd:string')));
 }
Exemple #30
0
 /**
  * class constructor
  *
  * @access	public
  */
 public function __construct()
 {
     // global objects
     foreach (array_keys(get_object_vars(registry::instance())) as $object) {
         if (!isset($this->{$object})) {
             $this->{$object} = registry::instance()->{$object};
         }
     }
     // load database library
     $this->db = $this->load->database();
 }