本文整理汇总了PHP中Session::getContextValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::getContextValue方法的具体用法?PHP Session::getContextValue怎么用?PHP Session::getContextValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::getContextValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLang
/**
* Toma el valor para el idioma.
* @param optional string $lang The language abbriviation.
*
* @access public
*
*/
function setLang($lang = null)
{
include_once Util::base_Path('include/classes/nls.inc.php');
//Debug::oneVar($lang, __FILE__, __LINE__);
if (empty($lang) || !NLS::isValid($lang)) {
if (Session::getValue('lang') != null) {
$lang = Session::getValue('lang');
} else {
if (Session::getContextValue('gettext_lang') != null) {
$lang = Session::getContextValue('gettext_lang');
} else {
$lang = 'es_ES';
}
}
}
Session::setValue('language', $lang);
//Debug::oneVar($lang, __FILE__, __LINE__);
/* First try language with the current charset. */
$lang_charset = $lang . '.' . NLS::getCharset();
if ($lang_charset != setlocale(LC_ALL, $lang_charset)) {
/* Next try language with its default charset. */
global $nls;
$charset = !empty($nls['charsets'][$lang]) ? $nls['charsets'][$lang] : $nls['defaults']['charset'];
$lang_charset = $lang . '.' . $charset;
NLS::_cachedCharset(0, $charset);
if ($lang_charset != setlocale(LC_ALL, $lang_charset)) {
/* At last try language solely. */
$lang_charset = $lang;
setlocale(LC_ALL, $lang_charset);
}
}
@putenv('LANG=' . $lang_charset);
@putenv('LANGUAGE=' . $lang_charset);
}
示例2: right_block
function right_block()
{
//$this->add(html_br());
$table = html_table(Session::getContextValue('mainInterfaceWidth'), 0, 1, 0);
$table->add_row(html_td('', '', $this->_getFileContent($this->getViewVariable('url'))));
return $table;
}
示例3: main_block
/**
*
*/
function main_block()
{
$main = html_div();
$main->set_id('content');
$title = html_h2('Se ha producido un error');
$title->set_tag_attribute('class', 'warncolor');
$main->add($title);
//Puede no estar definido el contexto
$width = Session::getContextValue('mainInterfaceWidth');
if (!isset($width)) {
$width = '100%';
}
$table = html_table($width, 0, 1, 0);
//Puede no estar definido el error
$error = $this->getViewVariable('str_error');
if (!isset($error)) {
$error = 'No error code was given';
}
$row = html_td('warncolor', '', $error);
$row->set_tag_attribute('align', 'center');
$table->add_row($row);
//Puede no estar definido la url de retorno
$url = $this->getViewVariable('str_url');
if (isset($url)) {
$row = html_td('', '', html_a($url, agt('Volver')));
$row->set_tag_attribute('align', 'center');
$table->add_row($row);
}
$main->add($table);
return $main;
}
示例4: main_block
/**
*
*/
function main_block()
{
$main = html_div();
$main->set_id("content");
$title = html_h2("Se ha producido un error");
$title->set_tag_attribute("class", "warncolor");
$main->add($title);
//Puede no estar definido el contexto
$width = Session::getContextValue("mainInterfaceWidth");
if (!isset($width)) {
$width = "100%";
}
$table = html_table($width, 0, 8, 0);
//Puede no estar definido el error
$error = $this->getViewVariable('str_error');
if (!isset($error)) {
$error = "No error code was given";
}
$row = html_td("warncolor", "", $error);
$row->set_tag_attribute("align", "center");
$table->add_row($row);
//Puede no estar definido la url de retorno
$url = $this->getViewVariable('str_url');
if (isset($url)) {
$row = html_td("", "", html_a($url, _('Volver')));
$row->set_tag_attribute("align", "center");
$table->add_row($row);
}
$main->add($table);
return $main;
}
示例5: main_block
function main_block()
{
$main = html_div();
$table = html_table(Session::getContextValue("mainInterfaceWidth"), 0, 1, 0);
$table->add_row($this->_block());
$main->add($table);
return $main;
}
示例6: add_info
function add_info($arrActivities)
{
$table = html_table(Session::getContextValue('mainInterfaceWidth'), 0, 0, 5);
$title = html_td('ptabla01', '', 'Activities del curso');
$title->set_tag_attribute('colspan', 3);
$table->add_row($title);
for ($i = 0; $i < count($arrActivities); $i++) {
$table->add($this->add_activity($arrActivities[$i]['title'], $arrActivities[$i]['body'], $arrActivities[$i]['id'], $i));
}
$table->add_row($title);
return $table;
}
示例7: main_block
/**
* We override this method to automatically
* break up the main block into a
* left block and a right block
*
* @param TABLEtag object.
*/
function main_block()
{
$main = html_div();
$main->set_id("content");
$table = html_table(Session::getContextValue("mainInterfaceWidth"), 0, 1, 0);
$table->set_class("simple");
//Centros
$elem1 = html_td("color1-bg", "", $this->left_block());
$table->add_row($elem1);
$main->add($table);
return $main;
}
示例8: log
/**
* Inserta en el Log el mensaje.
* @param string $message Mensaje a guardar en el Log
* @param string $ident Identificador de 'usuario'.
* @param string $priority Nivel de log
*/
function log($message, $ident, $priority = PEAR_LOG_WARNING)
{
if (MIGUELBASE_LOG_ACTIVE) {
switch (MIGUELBASE_LOG_TYPE) {
case 'file':
$conf = array('mode' => 0600, 'timeFormat' => '%Y/%m/%d %H:%M:%S');
$logger =& Log::singleton('file', MIGUELBASE_LOG_FILE, 'miguelOO_' . $ident, $conf);
break;
case 'adodb':
$db_conf = array('ddbbSgbd' => Session::getContextValue('ddbbSgbd'), 'ddbbServer' => Session::getContextValue('ddbbServer'), 'ddbbUser' => Session::getContextValue('ddbbUser'), 'ddbbPassword' => Session::getContextValue('ddbbPassword'), 'ddbbMainDb' => Session::getContextValue('ddbbMainDb'));
$conf = array('dsn' => $db_conf);
$logger =& Log::singleton('adodb', MIGUELBASE_LOG_TABLE, 'miguelOO_' . $ident, $conf);
break;
default:
$logger =& Log::singleton('error_log', 0, 'miguelOO_' . $ident);
}
switch (MIGUELBASE_LOG_LEVEL) {
case 'ALL':
$mask = Log::UPTO(PEAR_LOG_DEBUG);
break;
case 'EMERG':
$mask = Log::UPTO(PEAR_LOG_EMERG);
break;
case 'ALERT':
$mask = Log::UPTO(PEAR_LOG_ALERT);
break;
case 'CRITIC':
$mask = Log::UPTO(PEAR_LOG_CRIT);
break;
case 'ERROR':
$mask = Log::UPTO(PEAR_LOG_ERR);
break;
case 'WARNING':
$mask = Log::UPTO(PEAR_LOG_WARNING);
break;
case 'NOTICE':
$mask = Log::UPTO(PEAR_LOG_NOTICE);
break;
case 'INFO':
$mask = Log::UPTO(PEAR_LOG_INFO);
break;
case 'DEBUG':
$mask = Log::UPTO(PEAR_LOG_DEBUG);
break;
default:
$mask = PEAR_LOG_NONE;
}
$logger->setMask($mask);
//Debug::oneVar($logger,__FILE__,__LINE__);
$logger->log($message, $priority);
}
}
示例9: formatContent
function formatContent($filename)
{
$table = html_table(Session::getContextValue("mainInterfaceWidth"));
$table->set_tag_attribute('align', 'center');
$row2 = html_tr();
$data = 'Fichero vacio o no existe';
//Debug::oneVar($filename, __FILE__, __LINE__);
if (file_exists($filename) && is_file($filename)) {
ob_start();
include_once $filename;
$data = ob_get_contents();
ob_end_clean();
}
$table->add_row($data);
return $table;
}
示例10: add_info
function add_info($objectives, $description, $contents)
{
// $row = html_tr();
$table = html_table(Session::getContextValue('mainInterfaceWidth'), 0, 0, 5);
$title = html_td('ptabla01', '', 'Ficha del curso');
$title->set_tag_attribute('colspan', 2);
$titleObj = html_td('ptabla02', '', 'Objetivos');
$textObj = html_td('ptabla03', '', $objectives);
$titleDes = html_td('ptabla02', '', 'Descripción');
$textDes = html_td('ptabla03', '', $description);
$titleCon = html_td('ptabla02', '', 'Contenidos');
$textCon = html_td('ptabla03', '', $contents);
$table->add_row($title);
$table->add_row($titleObj, $textObj);
$table->add_row($titleDes, $textDes);
$table->add_row($titleCon, $textCon);
$table->add_row($title);
return $table;
}
示例11: _contactDetail
function _contactDetail()
{
$table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 2, 2);
$contact = $this->getViewVariable('detail_contacts');
if (is_array($contact) && $contact[0]['contact.contact_id'] != null) {
$table->add_row($this->add_info('Nombre', $contact[0]['contact.contact_name']));
$table->add_row($this->add_info('Apellido', $contact[0]['contact.contact_surname']));
if ($contact[0]['contact.contact_nick'] != null) {
$table->add_row($this->add_info('Usuario', $contact[0]['contact.contact_nick']));
}
$table->add_row($this->add_info('Correo electrónico', $contact[0]['contact.contact_mail']));
$table->add_row($this->add_info('Comentarios', nl2br($contact[0]['contact.contact_comments'])));
}
$btDel = html_a(Util::format_URLPath("contact/index.php", "contact_id=" . $contact[0]['contact.contact_id'] . "&option=delete"), 'Eliminar', null, '_top');
$btDel->set_tag_attribute('class', '');
$btBack = html_a(Util::format_URLPath("contact/index.php", ''), 'Volver', null, '_top');
$btBack->set_tag_attribute('class', '');
$table->add_row($btBack, $btDel);
return $table;
}
示例12: formatContent
function formatContent($filename)
{
$table = html_table(Session::getContextValue("mainInterfaceWidth"));
$table->set_tag_attribute('align', 'center');
//Cuerpo
$row1 = html_tr();
$data = 'Fichero vacio o no existe';
//Debug::oneVar($filename, __FILE__, __LINE__);
if (file_exists($filename) && is_file($filename)) {
ob_start();
include_once $filename;
$data = ob_get_contents();
ob_end_clean();
}
$table->add_row($data);
$form = html_td('ptexto01', '', $this->addForm('courseViewer', 'miguel_externalForm'));
$form->set_tag_attribute('align', 'center');
$table->add_row($form);
return $table;
}
示例13: right_block
function right_block()
{
$main = html_div();
$main->set_tag_attribute('width', Session::getContextValue('mainInterfaceWidth'));
$hr = html_hr();
$hr->set_tag_attribute('noshade');
$hr->set_tag_attribute('size', 2);
//Añade la linea horizontal al contenedor principal
$main->add($hr);
$table = html_table(Session::getContextValue('mainInterfaceWidth'), 0, 1, 0);
$table->set_tag_attribute('border');
//Cabecera
$elem1 = html_td('ptabla02', '', html_b('Perfil'));
$elem1->set_tag_attribute('width', '50%');
$elem2 = html_td('ptabla02', '', html_b('Conexiones'));
$elem2->set_tag_attribute('align', 'right');
$elem3 = html_td('ptabla02', '', html_b('%'));
$elem3->set_tag_attribute('align', 'right');
$table->add_row($elem1, $elem2, $elem3);
$arrUsers = $this->getViewVariable('arrUsers');
$iTotalCon = $this->getViewVariable('iTotalCon');
for ($i = 0; $i < count($arrUsers); $i++) {
$elem1 = html_td('ptabla03', '', $arrUsers[$i]['user.user_alias']);
$elem2 = html_td('ptabla03', '', $arrUsers[$i]['countLogin']);
$elem2->set_tag_attribute('align', 'right');
$porc = sprintf('%.2f', $arrUsers[$i]['countLogin'] * 100 / $iTotalCon);
$elem3 = html_td('ptabla03', '', $porc);
$elem3->set_tag_attribute('align', 'right');
$table->add_row($elem1, $elem2, $elem3);
}
$elem1 = html_td('ptabla03', '', html_b('TOTAL'));
$elem2 = html_td('ptabla03', '', html_b($iTotalCon));
$elem2->set_tag_attribute('align', 'right');
$elem3 = html_td('ptabla03', '', html_b(100));
$elem3->set_tag_attribute('align', 'right');
$table->add_row($elem1, $elem2, $elem3);
$main->add($table);
return $main;
}
示例14: crearLogin
function crearLogin()
{
$typeLogin = strtoupper(Session::getContextValue('typeLogin'));
$typeEncrypt = strtoupper(Session::getContextValue('typeEncrypt'));
$typeEncryptMcrypt = Session::getContextValue('typeEncryptMcrypt');
if ($typeLogin == 'BBDD') {
if ($typeEncrypt == 'PLAIN') {
return new base_loginPlano();
} else {
if ($typeEncrypt == 'MD5') {
return new base_loginMD5();
} else {
if ($typeEncrypt == 'MCRYPT') {
return new base_loginMCRYPT($typeEncryptMcrypt);
}
}
}
} else {
if ($typeLogin == 'LDAP') {
}
}
}
示例15: main_block
function main_block()
{
$main = html_div();
$main->set_id('content');
$table = html_table(Session::getContextValue('mainInterfaceWidth'), 0, 1, 0);
$table->set_class('simple');
//Barra Herramientas
if ($this->str_type == 'toolbar') {
$elem1 = html_td('', '', $this->left_block());
//$elem1->set_id("anonymous");
//$elem1->set_tag_attribute('width', 40);
//$elem1->set_tag_attribute('valign', 'top');
}
//Principal
$elem2 = html_td('toolmain', '', $this->right_block());
//$elem2->set_tag_attribute('valign', 'top');
//$elem2->set_id("identification");
$row = html_tr();
$row->add($elem1);
$row->add($elem2);
$table->add_row($row);
$main->add($table);
return $main;
}