/** * Constructs the object * @param string $query The query * @param string $query The query before the redirect (e.g. oprobiu before the automatic redirect to oprobriu) * @param int $searchType The seach type * @param boolean $redirect If true, then the result is a redirect [OPTIONAL] * @param Definition[] $results The results [OPTIONAL] * @access public * @return void **/ public function __construct($query, $queryBeforeRedirect, $searchType, $redirect = false, &$results = null) { if (!Config::get('global.logSearch') || lcg_value() > Config::get('global.logSampling')) { $this->query = null; return false; } $this->query = $query; $this->queryBeforeRedirect = $queryBeforeRedirect; $this->searchType = $searchType; if (session_variableExists('user')) { $this->registeredUser = '******'; $this->preferences = $_SESSION['user']->preferences; } else { $this->registeredUser = '******'; $this->preferences = session_getCookieSetting('anonymousPrefs'); } $this->skin = session_getSkin(); $this->resultCount = count($results); $this->redirect = $redirect ? 'y' : 'n'; $this->resultList = ''; if ($results != null) { $numResultsToLog = min(count($results), Config::get('global.logResults')); $this->resultList = ''; for ($i = 0; $i < $numResultsToLog; $i++) { $this->resultList .= ($this->resultList ? ',' : '') . $results[$i]->id; } } }
<?php require_once "../phplib/util.php"; require_once "../phplib/userPreferences.php"; util_assertNotLoggedIn(); $sendButton = util_getRequestParameter('send'); if ($sendButton) { $userPrefs = util_getRequestCheckboxArray('userPrefs', ','); $skin = util_getRequestParameter('skin'); session_setAnonymousPrefs($userPrefs); if (session_isValidSkin($skin)) { session_setSkin($skin); } FlashMessage::add('Preferințele au fost salvate.', 'info'); util_redirect('preferinte'); } else { $userPrefs = session_getAnonymousPrefs(); $skin = session_getSkin(); } foreach (preg_split('/,/', $userPrefs) as $pref) { if (isset($userPreferencesSet[$pref])) { $userPreferencesSet[$pref]['checked'] = true; } } smarty_assign('userPrefs', $userPreferencesSet); smarty_assign('skin', $skin); smarty_assign('availableSkins', pref_getServerPreference('skins')); smarty_assign('page_title', 'Preferințe'); smarty_displayCommonPageWithSkin('preferinte.ihtml');
function smarty_displayPageWithSkin($templateName) { $skin = session_getSkin(); smarty_assign('contentTemplateName', "{$skin}/{$templateName}"); smarty_display(); }
static function displayPageWithSkin($templateName) { $skin = session_getSkin(); self::assign('contentTemplateName', "{$skin}/{$templateName}"); print self::fetchSkin(); }
static function displayPageWithSkin($templateName) { $skin = session_getSkin(); print self::fetchSkin("{$skin}/{$templateName}"); }
static function getSkin($user) { return session_getSkin(); }