/** * Constructor method */ public function init() { try { $this->logShow = $this->getObject('logshow', 'logger'); $this->objUser = $this->getObject('user', 'security'); $this->objLanguage = $this->getObject('language', 'language'); $this->objCatalogue = $this->getObject('catalogueconfig', 'modulecatalogue'); $objModules = $this->getObject('modules', 'modulecatalogue'); $this->objContext = $this->getObject('dbcontext', 'context'); //Load ContextContent class if ($objModules->checkIfRegistered('contextcontent')) { $this->objContentOrder = $this->getObject('db_contextcontent_order', 'contextcontent'); $this->contextFlag = TRUE; } else { $this->contextFlag = FALSE; } $this->objFeatureBox = $this->newObject('featurebox', 'navigation'); $this->loadClass('htmlheading', 'htmlelements'); $this->loadClass('htmltable', 'htmlelements'); $this->loadClass('link', 'htmlelements'); $this->loadClass('windowpop', 'htmlelements'); } catch (Exception $e) { throw customException($e->getMessage()); exit; } }
/** * Class Constructor * * @access public * @return void */ public function init() { try { parent::init('tbl_module_blocks'); } catch (Exception $e) { throw customException($e->getMessage()); exit; } }
/** * Constructor method */ public function init() { try { parent::init('tbl_logger'); $this->objUser = $this->getObject('user', 'security'); } catch (Exception $e) { throw customException($e->getMessage()); exit; } }
/** * Constructor method */ public function init() { try { // Set the parent table parent::init('tbl_logger'); // Set default to log each time the page is loaded $this->logOncePerSession = FALSE; // Get an instance of the user object $this->objUser = $this->getObject('user', 'security'); $this->userId = $this->objUser->userId(); } catch (Exception $e) { throw customException($e->getMessage()); exit; } }
/** * Standard init function */ function init() { try { $this->logDisplay = $this->getObject('logdisplay', 'logger'); //Instantiate the show log class $this->showLog = $this->getObject('logshow'); //Instantiate the language object $this->objlanguage = $this->getObject('language', 'language'); //Get the activity logger class $this->objLog = $this->newObject('logactivity', 'logger'); //Set it to log once per session //$this->objLog->logOncePerSession = TRUE; //Log this module call $this->objLog->log(); $this->objUser = $this->getObject('user', 'security'); } catch (Exception $e) { throw customException($e->getMessage()); exit; } }
/** * * Method to take a delimited string of parameter and value pairs * and return an array of key=>value as well as set a property of * this class equal to each parameter and value. * * @param string $str A delimited string of parameters * @param string $delim A delimiter to separate the pairs * @return string array An array of key=>values * */ public function getArrayParams($str, $delim = ",") { $ar = explode($delim, $str); $ret = array(); try { foreach ($ar as $item) { //Split them up in to a string representing each pair $tmpAr = explode("=", trim($item)); //Make sure that there is a pair if (count($tmpAr) == 2) { $pName = trim($tmpAr[0]); $pValue = trim($tmpAr[1]); $ret[$pName] = $pValue; //Set a property for this class for easy use $this->{$pName} = $pValue; } } return $ret; } catch (Exception $e) { throw customException($e->getMessage()); //customException::cleanUp(); exit; } }
/** * * Get a canvas for display and selection. * * @access private * @return string The formatted canvas for view and selection * */ private function getSkinCanvasView($canvas) { try { $dirToOpen = "skins/" . $this->curSkin . "/canvases/"; $jsonFile = $dirToOpen . $canvas . '/canvas.json'; $jsonFile = file_get_contents($jsonFile); $jsonObj = json_decode($jsonFile); $divTag = "<div class='canvasthumb'>"; $divClose = "</div>"; $canvasName = $jsonObj->name; $canvasName = $this->getSkinChooserLink($canvasName, 'skin'); $anchor = "<a href='" . $dirToOpen . $canvas . "/" . $jsonObj->preview->fullview . "' rel='facebox'>"; //gb_imageset[skin_canvases] $anchorClose = "</a>"; $imageLink = "<img src='" . $dirToOpen . $canvas . "/" . $jsonObj->preview->thumb . "' />"; $by = $this->objLanguage->languageText("word_by"); $author = $by . ": " . $jsonObj->author->authorname; $downloadLink = $this->getDownLink($jsonObj->downloadfrom); // @TODO add the download link return $divTag . $canvasName . $anchor . $imageLink . $anchorClose . $author . $downloadLink . $divClose; } catch (Exception $e) { throw customException($e->message()); exit; } }
/** * * Get the sanitized username * * @return string The sanitized username * @access public * */ public function sanitize($value, $isAjax = FALSE) { if (strlen($value) > 255) { $er = $this->objLanguage->languageText("mod_login_uptoolong", "login", "Attempt to use illegal username or password"); throw customException($er); exit; } // Array of illegal contents of fields $illegalTerms = array("SELECT", "SHOW TABLES", "SHOW DATABASES", "INSERT", "DELETE", "JAVASCRIPT"); $value = stripslashes($value); $value = strip_tags($value); foreach ($illegalTerms as $term) { $valueTest = strtoupper($value); if (strstr($valueTest, $term)) { if ($isAjax) { die('badwords'); } else { $er = $this->objLanguage->languageText("mod_login_badwords", "login", "Illegal content detected in the input") . ": {$term}"; throw new customException($er); } } } $value = str_replace("'", NULL, $value); return $value; }
/** * Standard init function * * Instantiate language and user objects and create title * * @return NULL */ public function init() { try { $this->objLanguage =& $this->getObject('language', 'language'); $this->objUser = $this->getObject('user', 'security'); $this->title = $this->objLanguage->languageText("mod_canvas_selecttype", "canvas"); // Load the link class $this->loadClass('link', 'htmlelements'); } catch (Exception $e) { throw customException($e->message()); exit; } }
/** * Standard init function * * Instantiate language and user objects and create title * * @return NULL * @access public * */ public function init() { try { $this->objLanguage =& $this->getObject('language', 'language'); $this->objUser = $this->getObject('user', 'security'); $this->title = $this->objLanguage->languageText("mod_canvas_viewer", "canvas"); } catch (Exception $e) { throw customException($e->message()); exit; } }
/** * Standard block show method. It uses the renderform * class to render the login box */ public function show() { try { $allowRegistration = strtolower($this->objSysConfig->getValue('MOD_SECURITY_ALLOWREGISTRATION', 'security')); if ($allowRegistration !== "false") { if ($this->objUser->isLoggedIn()) { return NULL; } else { $regModule = $this->objSysConfig->getValue('REGISTRATION_MODULE', 'security'); if (empty($regModule)) { $regModule = 'userregistration'; } $registrationSize = $this->objSysConfig->getValue('registrationsize', 'userregistration'); if (strtolower($registrationSize) == 'big') { return $this->getBigForm($regModule); } else { return $this->getRegForm(); } } } else { return NULL; } } catch (Exception $e) { throw customException($e->getMessage()); exit; } }