function getImgSrc($array = "") { global $web_img_upload_path; // return $array['filename']; // mydump ($array); if ($array['filename'] == "") { if (!is_array($array)) { $array = array("imgTag" => imgTagThumb, "type" => "article"); } $array['filename'] = "archive/no_image_" . getLanguage() . ".gif"; } // different types can have different settings switch (strtolower($array['type'])) { case tOffersType_Article: case "article": case tOffersType_Service: case "service": $addition = ""; if (strtolower(substr($array["imgTag"], 0, 6)) == "imgtag") { $tag = $array["imgTag"]; eval("\$addition = {$tag};"); } else { $addition = $array["imgTag"]; } $path = $web_img_upload_path; // add special file code for different size images in articles $file = $web_img_upload_path . "/" . ereg_replace("(.[a-z0-9]{2,5})\$", $addition . "\\1", $array["filename"]); break; default: $path = $web_img_upload_path; $file = $path . "/" . $array["filename"]; } // switch return $file; }
public function __construct() { $this->language = getLanguage(); $this->pdo = new PDO('mysql:host=' . DATABASE_HOST . ';dbname=' . DATABASE_NAME, DATABASE_USERNAME, DATABASE_PASSWORD); global $router; $this->router = $router; $this->userProfile = new stdClass(); $this->userProfile->type = 'guest'; if (isset($_COOKIE['user_id'])) { $id = $_COOKIE['user_id']; $sql = "SELECT * FROM users WHERE `id`=:id LIMIT 1"; $query = $this->pdo->prepare($sql); $query->bindValue(':id', $id); $query->execute(); $user = $query->fetch(PDO::FETCH_OBJ); if ($user != false) { $this->userId = $user->id; $this->userProfile = $user; $this->userProfile->name = ucfirst($user->first_name) . ' ' . ucfirst($user->last_name); $birthday = strtotime($this->userProfile->birthday); $this->userProfile->age = date('md', $birthday) > date('md') ? date('Y') - date('Y', $birthday) - 1 : date('Y') - date('Y', $birthday); $this->setUserChildren(); // TO-DO.. // Current stuff (what's the current height, weight) to particular date... } else { setcookie('user_id', '', time() - 3600, '/'); // TO-DO..set the path right } } }
public function show() { require_once _base_ . '/lib/lib.navbar.php'; require_once _lms_ . '/lib/lib.middlearea.php'; $ma = new Man_MiddleArea(); $block_list = array(); //if($ma->currentCanAccessObj('user_details_short')) $block_list['user_details_short'] = true; if ($ma->currentCanAccessObj('user_details_full')) { $block_list['user_details_full'] = true; } if ($ma->currentCanAccessObj('credits')) { $block_list['credits'] = true; } if ($ma->currentCanAccessObj('news')) { $block_list['news'] = true; } $query_home = "SELECT title, description FROM learning_webpages where publish=1 and in_home = 1 AND language = '" . getLanguage() . "' LIMIT 1"; $re_home = sql_query($query_home); list($titolo, $descrizione) = sql_fetch_row($re_home); if (!empty($block_list)) { $this->render('_tabs_block', array('active_tab' => 'home', '_content' => "<div id=\"tabhome_title\"><h1>" . $titolo . "</h1></div><div id=\"tabhome_description\">" . $descrizione . "</div>", 'block_list' => $block_list)); } else { $this->render('_tabs', array('active_tab' => 'home', '_content' => "<div id=\"tabhome_title\"><h1>" . $titolo . "</h1></div><div id=\"tabhome_description\">" . $descrizione . "</div>")); } }
public function run() { require_once _lms_ . '/lib/lib.kbres.php'; $kbres = new KbRes(); $data = false; if ($this->res_id > 0) { $data = $kbres->getResource($this->res_id, true, true); } else { if (!empty($this->r_item_id) && !empty($this->r_type)) { $data = $kbres->getResourceFromItem($this->r_item_id, $this->r_type, $this->r_env, true, true); } } if ($data == false) { $data = array('res_id' => 0, 'r_name' => '', 'original_name' => '', 'r_desc' => '', 'r_item_id' => $this->r_item_id, 'r_type' => $this->r_type, 'r_env' => $this->r_env, 'r_env_parent_id' => $this->r_env_parent_id, 'r_param' => $this->r_param, 'r_alt_desc' => '', 'r_lang' => !empty($this->language) ? $this->language : getLanguage(), 'force_visible' => 0, 'is_mobile' => 0, 'folders' => array(), 'tags' => array()); } if (!empty($this->original_name)) { $data['original_name'] = $this->original_name; } $c_folders = array_keys($data['folders']); unset($data['folders']); $c_tags = $data['tags']; unset($data['tags']); $json = new Services_JSON(); $this->render('kbcategorize', array('selected_node' => $this->_getSelectedNode(), 'back_url' => $this->back_url, 'form_url' => $this->form_url, 'form_extra_hidden' => $this->form_extra_hidden, 'data' => $data, 'c_folders' => $c_folders, 'c_tags_json' => $json->encode(array_values($c_tags)), 'all_tags_json' => $json->encode(array_values($kbres->getAllTags())))); }
/** * get language text * @param String $paramText text to convert * @param array/string $paramArgs sprintf args */ function l($paramText, $paramArgs = null) { if (!function_exists('getLanguage')) { return "!!LANGUAGE_NOT_LOADED!!"; } return getLanguage()->getText($paramText, $paramArgs); }
function __($str = '') { $lang = getLanguage(); if (file_exists(APPLICATION_PATH . 'languages/' . $lang . '.php')) { $translations = (include APPLICATION_PATH . 'languages/' . $lang . '.php'); if (isset($translations) && isset($translations[$str])) { $str = $translations[$str]; } } return $str; }
/** * The news link for the home pages * @return <html> */ public static function news($hnumber = 2) { $html = '<div id="news">'; $textQuery = "\r\n\t\tSELECT idNews, publish_date, title, short_desc\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news\r\n\t\tWHERE language = '" . getLanguage() . "'\r\n\t\tORDER BY important DESC, publish_date DESC\r\n\t\tLIMIT 0," . Get::sett('visuNewsHomePage'); //do query $result = sql_query($textQuery); if (sql_num_rows($hnumber)) { $html .= '<p>' . Lang::set('_NO_CONTENT', 'login') . '</p>'; } while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) { $html .= '<h' . $hnumber . '>' . '<a href="index.php?modname=login&op=readnews&idNews=' . $idNews . '">' . $title . '</a>' . '</h' . $hnumber . '>' . '<p class="news_textof">' . '<span class="news_data">' . Format::date($publish_date) . ' - </span>' . $short_desc . '</p>'; } $html .= '</div>'; return $html; }
function loadNewsBlock() { $lang = DoceboLanguage::createInstance('login'); $textQuery = "\r\n\tSELECT idNews, publish_date, title, short_desc \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_news \r\n\tWHERE language = '" . getLanguage() . "'\r\n\tORDER BY important DESC, publish_date DESC"; $result = sql_query($textQuery); $html = '<div class="home_news_block">' . '<h1>' . $lang->def('_NEWS') . '</h1>'; while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) { $html .= '<h2>' . '<a href="index.php?modname=login&op=readnews&idNews=' . $idNews . '">' . $title . '</a></h2>' . '<p><span class="news_data">' . $lang->def('_DATE') . ' ' . Format::date($publish_date, 'date') . ': </span>' . $short_desc . '</p>'; } if (mysql_num_rows($result) == 0) { $html .= $lang->def('_NO_CONTENT'); } $html .= '</div>'; return $html; }
function news() { $textQuery = "\r\n\tSELECT idNews, publish_date, title, short_desc\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_news\r\n\tWHERE language = '" . getLanguage() . "'\r\n\tORDER BY important DESC, publish_date DESC"; $lang = DoceboLanguage::createInstance('login'); $GLOBALS['page']->add(getTitleArea($lang->def('_NEWS'), 'news', $lang->def('_NEWS')) . '<div class="news_block">' . getBackUi('index.php', $lang->def('_BACK')), 'content'); //do query $result = sql_query($textQuery); while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) { $GLOBALS['page']->add('<div class="news_title">' . '<a href="index.php?modname=login&op=readnews&idNews=' . $idNews . '">' . $title . '</a></div>' . '<div class="news_textof">' . '<span class="news_data">' . $lang->def('_DATE') . ' ' . $publish_date . ' - </span>' . $short_desc . '</div>', 'content'); } if (mysql_num_rows($result) == 0) { $GLOBALS['page']->add($lang->def('_NO_CONTENT'), 'content'); } elseif (mysql_num_rows($result) >= 3) { $GLOBALS['page']->add(getBackUi('index.php', $lang->def('_BACK')) . '</div>', 'content'); } $GLOBALS['page']->add('</div>', 'content'); }
function mycompetences(&$url) { checkPerm('view'); $html = ""; $html .= getTitleArea(Lang::t('_COMPETENCES'), 'competences'); $html .= '<div class="std_block">'; $cmodel = new CompetencesAdm(); $fmodel = new FunctionalrolesAdm(); $id_user = getLogUserId(); $ucomps = $cmodel->getUserCompetences($id_user); $rcomps = $fmodel->getUserRequiredCompetences($id_user); $ucomps_info = $cmodel->getCompetencesInfo(array_keys($ucomps)); $language = getLanguage(); $_typologies = $cmodel->getCompetenceTypologies(); $_types = $cmodel->getCompetenceTypes(); $icon_actv = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_COMPETENCE_OBTAINED', 'competences') . '</span></span>'; $icon_req = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MANDATORY', 'competences') . '</span></span>'; //******************* require_once _base_ . '/lib/lib.table.php'; $table = new Table(Get::sett('visuItem'), Lang::t('_COMPETENCES'), Lang::t('_COMPETENCES')); $style_h = array('', '', 'image', 'image', 'image', 'image', 'image'); $label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_SCORE', 'competences'), Lang::t('_DATE_LAST_COMPLETE', 'subscribe'), Lang::t('_COMPETENCES_REQUIRED', 'competences')); $table->addHead($label_h, $style_h); foreach ($ucomps_info as $id_competence => $cinfo) { $line = array(); $line[] = $cinfo->langs[$language]['name']; $line[] = $_typologies[$cinfo->typology]; $line[] = $_types[$cinfo->type]; $line[] = $cinfo->type == 'score' ? '<b>' . $ucomps[$id_competence]->score_got . '</b>' : $icon_actv; $line[] = Format::date($ucomps[$id_competence]->last_assign_date, 'datetime'); $line[] = array_key_exists($id_competence, $rcomps) ? $icon_req : ''; $table->addBody($line); } $html .= $table->getTable(); $html .= '</div>'; $html .= Form::openForm('beck_url', 'index.php'); $html .= Form::openButtonSpace(); $html .= Form::getButton('close', 'close', Lang::t('_CLOSE', 'standard')); $html .= Form::closeButtonSpace(); $html .= Form::closeform(); cout($html, 'content'); }
public function __construct($viewFile = null) { if (null !== $viewFile) { $this->_module = 'www'; if (strstr($viewFile, DS)) { $this->_viewFile = $viewFile; } else { $file = CACHE_PATH . DS . md5($this->_viewFile . time() . Utils::UUID()) . '.fake'; File::create($file); $fp = fopen($file, 'a'); fwrite($fp, '<?php echo $this->content; ?>'); $this->_viewFile = $file; } } else { $route = Utils::get('appDispatch'); /* polymorphism */ $route = !$route instanceof Container ? container()->getRoute() : $route; if ($route instanceof Container) { $module = $route->getModule(); $controller = $route->getController(); $action = $route->getAction(); $this->_module = $module; $isTranslate = Utils::get('isTranslate'); if (true === $isTranslate) { $lng = getLanguage(); if (true === container()->getMultiSite()) { $this->_viewFile = APPLICATION_PATH . DS . SITE_NAME . DS . 'modules' . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($lng) . DS . Inflector::lower($action) . '.phtml'; } else { $this->_viewFile = APPLICATION_PATH . DS . 'modules' . DS . SITE_NAME . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($lng) . DS . Inflector::lower($action) . '.phtml'; } } else { if (true === container()->getMultiSite()) { $this->_viewFile = APPLICATION_PATH . DS . SITE_NAME . DS . 'modules' . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($action) . '.phtml'; } else { $this->_viewFile = APPLICATION_PATH . DS . 'modules' . DS . SITE_NAME . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($action) . '.phtml'; } } } } Utils::set('appView', $this); Utils::set('showStats', true); }
function isLanguageKey($key, $language = null) { global $lang; if (!$language) { $language = getLanguage(); } if (!count($lang)) { $directoryHandler = dir("language/" . $language); while (($fileEntry = $directoryHandler->read()) !== false) { if ($fileEntry != '.' && $fileEntry != '..' && strpos($fileEntry, ".php")) { include_once "language/" . $language . "/" . $fileEntry; } } $directoryHandler->close(); // Uncomment if you're not in UTF-8 // $lang = changeCharset($lang); } if (array_key_exists($key, $lang)) { return true; } return false; }
<?php include "../includes/config.php"; include "../includes/classes.php"; include getLanguage(null, !empty($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang'], 2); session_start(); $db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']); if ($db->connect_errno) { echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error; } $db->set_charset("utf8"); $resultSettings = $db->query(getSettings()); $settings = $resultSettings->fetch_assoc(); if (isset($_SESSION['usernameAdmin']) && isset($_SESSION['passwordAdmin'])) { $loggedInAdmin = new loggedInAdmin(); $loggedInAdmin->db = $db; $loggedInAdmin->url = $CONF['url']; $loggedInAdmin->username = $_SESSION['usernameAdmin']; $loggedInAdmin->password = $_SESSION['passwordAdmin']; $loggedIn = $loggedInAdmin->verify(); if ($loggedIn['username']) { $managePayments = new managePayments(); $managePayments->db = $db; $managePayments->url = $CONF['url']; $managePayments->per_page = $settings['rperpage']; if (isset($_POST['start'])) { echo $managePayments->getPayments($_POST['start']); } } }
<?php include "../includes/config.php"; include "../includes/classes.php"; require_once getLanguage(null, !empty($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang'], 2); session_start(); $db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']); if ($db->connect_errno) { echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error; } $db->set_charset("utf8"); $resultSettings = $db->query(getSettings()); $settings = $resultSettings->fetch_assoc(); // The theme complete url $CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme']; if (isset($_POST['start']) && isset($_POST['q']) && ctype_digit($_POST['start'])) { $feed = new feed(); $feed->db = $db; $feed->url = $CONF['url']; if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) { $loggedIn = new loggedIn(); $loggedIn->db = $db; $loggedIn->url = $CONF['url']; $loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username']; $loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password']; $verify = $loggedIn->verify(); $feed->username = $verify['username']; $feed->id = $verify['idu']; $feed->online_time = $settings['conline']; if (!empty($_POST['list'])) { echo $feed->onlineUsers(2, $_POST['q']); return;
/** * This function encapsulate a set of common instruction for event notification generation * @param string $class The class name ho event (eg. UserMod) * @param string $module The module generator (eg. directory) * @param string $section The section in module that generate event (eg. edit) * @param int $priority The priority level of event * @param string $description The description of the event * @param array $recipients An array of userid that should be notified * @param EventMessageComposer $msg_composer a class for message composition * @param bool $force_email_send if true the message is sent to all the user in $recipients ignoring their settings for email **/ function createNewAlert($class, $module, $section, $priority, $description, $recipients, $msg_composer, $force_email_send = false) { $event =& DoceboEventManager::newEvent($class, $module, $section, $priority, $description); $event->deleteOldProperty(); if (is_array($recipients["to"]) && is_array($recipients["cc"]) && is_array($recipients["bcc"])) { $event->setProperty('recipientid', implode(',', $recipients["to"])); $event->setProperty('recipientcc', implode(',', $recipients["cc"])); $event->setProperty('recipientbcc', implode(',', $recipients["bcc"])); } else { $event->setProperty('recipientid', implode(',', $recipients)); } $event->setProperty('subject', addslashes($msg_composer->getSubject('email', getLanguage()))); $event->setProperty('body', addslashes($msg_composer->getBody('email', getLanguage()))); $msg_composer->prepare_serialize(); // __sleep is preferred but i preferr this method $event->setProperty('MessageComposer', addslashes(rawurlencode(serialize($msg_composer)))); $event->setProperty('force_email_send', $force_email_send === false ? 'false' : 'true'); DoceboEventManager::dispatch($event); }
if ($langcnt > 0) { ?> <ul> <li>Language: <select id="filterlang" onchange="{setLang(document.getElementById('filterlang'),'index.php');}"><?php echo get_languages_selectoptions($currentlang, '[Select...]'); ?> </select></li> </ul> <?php if ($currenttext != '') { $txttit = get_first_value('select TxTitle as value from ' . $tbpref . 'texts where TxID=' . (int) $currenttext); if (isset($txttit)) { $txtlng = get_first_value('select TxLgID as value from ' . $tbpref . 'texts where TxID=' . (int) $currenttext); $lngname = getLanguage($txtlng); ?> <ul> <li>My last Text (in <?php echo tohtml($lngname); ?> ):<br /> <i><?php echo tohtml($txttit); ?> </i> <br /> <a href="do_text.php?start=<?php echo $currenttext; ?> "><img src="icn/book-open-bookmark.png" title="Read" alt="Read" /> Read</a>
echo "\t\t</form></nobr>\n"; echo "\t</td>\n"; echo "</tr>\n"; echo "</table>\n"; } if (file_exists("../translation/locale_{$lang}.php")) { include "./translation/locale_{$lang}.php"; } else { include "../translation/locale_en.php"; } include_once "../conf/themes.php"; $g_szRequestedVersion = $_REQUEST["version"]; if ($g_szRequestedVersion == "") { $g_szRequestedVersion = $_SESSION["version"]; } $g_szRequestedLanguage = getLanguage(); $_SESSION["version"] = $g_szRequestedVersion; $g_iCurrentPage = $_REQUEST["page"]; if (!is_numeric($g_iCurrentPage)) { $g_iCurrentPage = $_SESSION["page"]; } if (!is_numeric($g_iCurrentPage)) { $g_iCurrentPage = 0; } $g_szRequestedSortOrder = $_REQUEST["sort"]; if ($g_szRequestedSortOrder == "") { $g_szRequestedSortOrder = $_SESSION["sort"]; } if ($g_aAvailableSortOrders[$g_szRequestedSortOrder] == "") { $g_szRequestedSortOrder = "name"; }
$message = ''; // Import if (isset($_REQUEST['op'])) { // INSERT if ($_REQUEST['op'] == 'Import') { $col[0] = $_REQUEST["Col1"]; $col[1] = $_REQUEST["Col2"]; $col[2] = $_REQUEST["Col3"]; $col[3] = $_REQUEST["Col4"]; $col[4] = $_REQUEST["Col5"]; $overwrite = $_REQUEST["Over"] == '1'; $tabs = $_REQUEST["Tab"]; $sqlct = 0; $lang = $_REQUEST["LgID"]; $status = $_REQUEST["WoStatus"]; $protokoll = '<h4>Import Report (Language: ' . getLanguage($lang) . ', Status: ' . $status . ')</h4><table class="tab1" cellspacing="0" cellpadding="5"><tr><th class="th1">Line</th><th class="th1">Term</th><th class="th1">Translation</th><th class="th1">Romanization</th><th class="th1">Sentence</th><th class="th1">Tag List</th><th class="th1">Message</th></tr>'; if (isset($_FILES["thefile"]) && $_FILES["thefile"]["tmp_name"] != "" && $_FILES["thefile"]["error"] == 0) { $lines = file($_FILES["thefile"]["tmp_name"], FILE_IGNORE_NEW_LINES); } else { $lines = explode("\n", prepare_textdata($_REQUEST["Upload"])); } $l = count($lines); for ($i = 0; $i < $l; $i++) { if ($tabs == 'h') { $lines[$i] = explode("#", trim(str_replace("\t", " ", $lines[$i]))); } elseif ($tabs == 'c') { $lines[$i] = my_str_getcsv(trim(str_replace("\t", " ", $lines[$i]))); } else { $lines[$i] = explode("\t", trim($lines[$i])); } $k = count($lines[$i]);
+-------------------------------------------------------------------------+ | facileManager: Easy System Administration | +-------------------------------------------------------------------------+ | http://www.facilemanager.com/ | +-------------------------------------------------------------------------+ */ /** * facileManager language translation functions * * @package facileManager * @subpackage i18n */ $directory = ABSPATH . 'fm-modules/' . $fm_name . '/languages'; $domain = $fm_name; $encoding = 'UTF-8'; $_SESSION['language'] = getLanguage($directory); putenv('LANG=' . $_SESSION['language']); setlocale(LC_ALL, $_SESSION['language']); if (function_exists('textdomain')) { bindtextdomain($domain, $directory); bind_textdomain_codeset($domain, $encoding); if (isset($_SESSION['module']) && $_SESSION['module'] != $fm_name) { loadModuleLanguage($_SESSION['module'], $encoding); } textdomain($domain); } /** * Returns if access to a zone is allowed * * @since 2.0 * @package facileManager
public function updateCompetenceDescription($id_competence, $description, $lang_code = false) { if ($id_competence <= 0) { return false; } if (!$lang_code) { $lang_code = getLanguage(); } $query = "UPDATE " . $this->_getCompetencesLangTable() . " " . " SET description = '" . $description . "' " . " WHERE id_competence = " . (int) $id_competence . " AND lang_code = '" . $lang_code . "'"; $res = $this->db->query($query); return $res ? true : false; }
function loadTempConfig($rp = 0) { global $config, $config_file; if (file_exists($config_file['permanent'])) { $GLOBALS['language'] = getLanguage(); $GLOBALS['error'] = '<h3>' . $GLOBALS['language']['already_succ'] . '</h3>' . $GLOBALS['language']['already_succ_explain']; return false; } else { // read the temporary file if (file_exists($config_file['temporary'])) { include $config_file['temporary']; $GLOBALS['config'] = $install_config; } else { $GLOBALS['config'] = array(); } } }
* - $language = the lang_code to use * - $title = dialog/page title; * - $json = Serci */ echo getTitleArea($title); ?> <div class="std_block"> <?php echo getBackUi('index.php?r=adm/functionalroles/show', Lang::t('_BACK', 'standard')); $html = ""; require_once _base_ . '/lib/lib.table.php'; $table = new Table(); $label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_REQUIRED_SCORE', 'fncroles'), Lang::t('_EXPIRATION_DAYS', 'fncroles'), Lang::t('_COURSE', 'course'), Lang::t('_SCORE', 'fncroles')); $style_h = array('', 'img-cell', 'img-cell', 'img-cell', '', 'img-cell'); $table->addHead($label_h, $style_h); $language = getLanguage(); $cmodel = new CompetencesAdm(); $_types = $cmodel->getCompetenceTypes(); $_typologies = $cmodel->getCompetenceTypologies(); $rs_counter = 1; foreach ($competences_info as $id_competence => $cinfo) { $courses = isset($courses_info[$id_competence]) ? $courses_info[$id_competence] : array(); $cinfo_content_1 = $cinfo->langs[$language]['name']; $cinfo_content_2 = $_types[$cinfo->type]; $cinfo_content_3 = $cinfo->type == 'score' ? $cinfo->role_score : '-'; $cinfo_content_4 = $cinfo->role_expiration > 0 ? $cinfo->role_expiration . ' ' . Lang::t('_DAYS', 'standard') : Lang::t('_NEVER', 'standard'); $num_courses = count($courses); if ($num_courses > 0) { $first = true; foreach ($courses as $course) { $line = array();
<li><a href="mobile.php#notyetimpl">Text Tags</a></li> <li class="group"><?php echo tohtml($langname); ?> Terms</li> <li><a href="mobile.php#notyetimpl">All <?php echo tohtml($langname); ?> Terms</a></li> <li><a href="mobile.php#notyetimpl">Term Tags</a></li> </ul> <?php } elseif ($action == 2) { $lang = $_REQUEST["lang"]; $langname = getLanguage($lang); $sql = 'select TxID, TxTitle from texts where TxLgID = ' . $lang . ' order by TxTitle'; $res = mysql_query($sql); if ($res == FALSE) { die("Invalid Query: {$sql}"); } ?> <ul id="<?php echo $action . '-' . $lang; ?> " title="All <?php echo tohtml($langname); ?> Texts">
<!-- English content ///////////////////////////////////////////////////////--> <div class="module_video"> <br /> <object width="640" height="385" data="http://www.youtube.com/v/iANRO3I30nM?fs=1&hl=en_EN" type="application/x-shockwave-flash"> <param name="movie" value="http://www.youtube.com/v/iANRO3I30nM?fs=1&hl=fr_FR"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> </object> <br /> </div> <?php } else { if (getLanguage() == LG_ES) { ?> <!-- Spanich content ///////////////////////////////////////////////////////--> <div class="module_video"> <br /> <object width="640" height="385" data="http://www.youtube.com/v/iANRO3I30nM?fs=1&hl=es_ES" type="application/x-shockwave-flash"> <param name="movie" value="http://www.youtube.com/v/iANRO3I30nM?fs=1&hl=fr_FR"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> </object> <br /> </div> <?php
public function home($application) { $data = $this->Db->findAll($application, NULL, "DESC", _maxLimit); if ($data) { $i = 1; foreach ($data as $record) { switch ($application) { case "pages": $list[] = li(a(getLanguage($record["Language"], TRUE) . " {$i}. " . $record["Title"], path("pages/" . $record["Slug"]), $record["Title"], TRUE)); break; case "blog": $URL = path("blog/" . $record["Year"] . "/" . $record["Month"] . "/" . $record["Day"] . "/" . $record["Slug"]); $list[] = li(a(getLanguage($record["Language"], TRUE) . ' ' . $i . '. ' . $record["Title"], $URL, $record["Title"], TRUE)); break; case "links": $list[] = li(a($i . ". " . $record["Title"], $record["URL"], $record["Description"], TRUE)); break; case "users": $list[] = li(a($i . ". " . $record["Username"], path("users/profile/" . $record["ID_User"]), $record["Username"], TRUE)); break; } $i++; } } else { $list = "<p>   " . __(_("There are no new records")) . "</p>"; } return $list; }
function connect() { require_once _base_ . '/lib/lib.userselector.php'; require_once _adm_ . '/lib/lib.field.php'; $aclManager = Docebo::user()->getACLManager(); $this->directory = new UserSelector(); $this->groupFilter_idst = $aclManager->getGroupST($this->groupFilter); // load language for fields names $lang_dir = DoceboLanguage::createInstance('admin_directory', 'framework'); $fl = new FieldList(); $this->fl = $fl; // root and root descendant $tmp = $aclManager->getGroup(false, '/oc_0'); $arr_idst[] = $tmp[0]; $this->tree_oc = $tmp[0]; $tmp = $aclManager->getGroup(false, '/ocd_0'); $arr_idst[] = $tmp[0]; $this->tree_ocd = $tmp[0]; // tree folder selected if ($this->tree != 0) { $arr_groupid = $aclManager->getGroupsId($arr_idst); foreach ($arr_groupid as $key => $val) { $arr_groupid[$key] = substr_replace($val, '/ocd', 0, 3); } $arr_result = $aclManager->getArrGroupST($arr_groupid); list($this->tree_desc) = array_values($arr_result); $arr_idst[] = $this->tree; $arr_idst[] = $this->tree_desc; } $arr_fields = $fl->getFieldsFromIdst($arr_idst); // generating cols descriptor $this->cols_descriptor = NULL; if ($this->dbconn === NULL) { $this->dbconn = $GLOBALS['dbConn']; } $query = "SHOW FIELDS FROM " . $GLOBALS['prefix_fw'] . "_user"; $rs = sql_query($query, $this->dbconn); if ($rs === FALSE) { $this->last_error = Lang::t('_OPERATION_FAILURE', 'standard') . $query . ' [' . mysql_error($this->dbconn) . ']'; return FALSE; } $this->cols_descriptor = array(); while ($field_info = mysql_fetch_array($rs)) { if (!in_array($field_info['Field'], $this->ignore_cols)) { $mandatory = in_array($field_info['Field'], $this->mandatory_cols); if (isset($this->default_cols[$field_info['Field']])) { $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $lang_dir->def('_DIRECTORY_FILTER_' . $field_info['Field']), DOCEBOIMPORT_COLID => $field_info['Field'], DOCEBOIMPORT_COLMANDATORY => $mandatory, DOCEBOIMPORT_DATATYPE => $field_info['Type'], DOCEBOIMPORT_DEFAULT => $this->default_cols[$field_info['Field']]); } else { $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $lang_dir->def('_DIRECTORY_FILTER_' . $field_info['Field']), DOCEBOIMPORT_COLID => $field_info['Field'], DOCEBOIMPORT_COLMANDATORY => $mandatory, DOCEBOIMPORT_DATATYPE => $field_info['Type']); } } } mysql_free_result($rs); foreach ($arr_fields as $field_id => $field_info) { if (in_array($field_info[FIELD_INFO_TYPE], $this->valid_filed_type)) { $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $field_info[FIELD_INFO_TRANSLATION], DOCEBOIMPORT_COLID => $field_id, DOCEBOIMPORT_COLMANDATORY => FALSE, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => false); } } $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => 'tree_code', DOCEBOIMPORT_COLID => 'tree_code', DOCEBOIMPORT_COLMANDATORY => FALSE, DOCEBOIMPORT_DATATYPE => 'text'); $this->arr_fields = $arr_fields; $this->index = 0; $this->eof = true; $match = array(); $this->org_chart_name = array(); $this->org_chart_group = array(); $this->user_org_chart = array(); // cache org_chart group $this->org_chart_group = $aclManager->getBasePathGroupST('/oc'); $query = " SELECT id_dir, translation " . " FROM " . $GLOBALS['prefix_fw'] . "_org_chart" . " WHERE lang_code = '" . getLanguage() . "'"; $result = sql_query($query); while (list($id_dir, $dir_name) = sql_fetch_row($result)) { $valid = preg_match('/' . $this->preg_match_folder . '/i', $dir_name, $match); if ($valid) { $dir_name = $match[1]; } $this->org_chart_name[$dir_name] = $id_dir; $idst_group = $this->org_chart_group['/oc_' . $id_dir]; $query_idstMember = "SELECT idstMember" . " FROM " . $GLOBALS['prefix_fw'] . "_group_members " . " WHERE idst = '" . $idst_group . "'"; $re = sql_query($query_idstMember); while (list($idstMember) = sql_fetch_row($re)) { if (!isset($this->user_org_chart[$idstMember])) { $this->user_org_chart[$idstMember] = array(); } $this->user_org_chart[$idstMember][$id_dir] = $id_dir; } } return TRUE; }
function translate($message, $from = 'eng', $to = 'dut') { $params = array("text" => $message, "from" => getLanguage($from), "to" => getLanguage($to)); $translator = curl_init('http://www.freetranslation.com/gw-mt-proxy-service-web/mt-translation'); curl_setopt($translator, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($translator, CURLOPT_POSTFIELDS, json_encode($params)); curl_setopt($translator, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($translator, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($translator, CURLOPT_RETURNTRANSFER, true); curl_setopt($translator, CURLOPT_HTTPHEADER, array('Host: www.freetranslation.com', 'Content-Type: application/json', 'Tracking: applicationKey=dlWbNAC2iLJWujbcIHiNMQ%3D%3D applicationInstance=freetranslation', 'Cache-Control: no-cache')); $response = json_decode(curl_exec($translator)); return $response->translation; }
/** * Returns license agreement from template, or default agreement * @return string */ public function getLicenseAgreement() { $licenses = $this->getLicensensesAgreements(); $locale = getLanguage(array('locale' => \CI::$APP->config->item('language'))); $locale = $locale ? $locale['identif'] : \MY_Controller::defaultLocale(); if (count($licenses) > 0) { if (key_exists($locale, $licenses)) { $licenseText = file_get_contents($licenses[$locale]); } else { // $licenseText = file_get_contents(current($licenses)); } return str_replace('{template_name}', $this->label, $licenseText); } return 0; }
$wh_tag2 = "group_concat(AgT2ID) IS NULL"; } else { $wh_tag2 = "concat('/',group_concat(AgT2ID separator '/'),'/') like '%/" . $currenttag2 . "/%'"; } } if ($currenttag1 != '' && $currenttag2 == '') { $wh_tag = " having (" . $wh_tag1 . ') '; } elseif ($currenttag2 != '' && $currenttag1 == '') { $wh_tag = " having (" . $wh_tag2 . ') '; } else { $wh_tag = " having ((" . $wh_tag1 . ($currenttag12 ? ') AND (' : ') OR (') . $wh_tag2 . ')) '; } } $no_pagestart = getreq('markaction') == 'deltag'; if (!$no_pagestart) { pagestart('My ' . getLanguage($currentlang) . ' Text Archive', true); } $message = ''; // MARK ACTIONS if (isset($_REQUEST['markaction'])) { $markaction = $_REQUEST['markaction']; $actiondata = stripTheSlashesIfNeeded(getreq('data')); $message = "Multiple Actions: 0"; if (isset($_REQUEST['marked'])) { if (is_array($_REQUEST['marked'])) { $l = count($_REQUEST['marked']); if ($l > 0) { $list = "(" . $_REQUEST['marked'][0]; for ($i = 1; $i < $l; $i++) { $list .= "," . $_REQUEST['marked'][$i]; }
function getPdf($html, $name, $img = false, $download = true, $facs_simile = false, $for_saving = false) { @ob_end_clean(); $query = "SELECT lang_browsercode, lang_direction" . " FROM " . $GLOBALS['prefix_fw'] . "_lang_language" . " WHERE lang_code = '" . getLanguage() . "'"; list($lang_code, $lang_direction) = mysql_fetch_row(mysql_query($query)); if (strpos($lang_code, ';') !== false) { $lang_code = current(explode(';', $lang_code)); } $lg = array(); $lg['a_meta_charset'] = "UTF-8"; $lg['a_meta_dir'] = $lang_direction; $lg['a_meta_language'] = $lang_code; $lg['w_page'] = "page"; $this->setLanguageArray($lg); /** * Protection for the PDF * * print : Print the document; * modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble'; * copy : Copy or otherwise extract text and graphics from the document; * annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields); * fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified; * extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes); * assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set; * print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality. * owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions. */ if ($this->isEncrypted()) { $this->SetProtection(array('modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), '', $this->getPassword()); } $this->getAliasNbPages(); $this->AddPage(); // set JPEG quality $this->setJPEGQuality(80); if ($img != '') { $this->setXY(0, 0); $this->Image($GLOBALS['where_files_relative'] . '/appLms/certificate/' . $img, 0, 0, $this->CurOrientation == 'P' ? 206 : 298, 0, '', '', '', true); $this->setXY(0, 0); } if ($facs_simile) { //Put watermark Author: Ivan $this->SetFont('dejavusans', '', 40); $this->SetTextColor(240, 240, 240); $this->RotatedText(15, 50, 'F a c - s i m i l e', 270); $this->SetFont("dejavusans", "", 10); $this->SetTextColor(0, 0, 0); } $this->setXY(0, 0); //$this->UseCSS(true); $this->WriteHTML($html); $name = str_replace(array('\\', '/', ':', '\'', '\\*', '?', '"', '<', '>', '|'), array('', '', '', '', '', '', '', '', '', ''), $name); // maybe there is a way to understand why ie6 doesn't use correctly the 'D' option, but this work so.... if ($for_saving) { return $this->Output('"' . $name . '.pdf"', 'S'); } $pdf = $this->Output('"' . $name . '.pdf"', 'S'); session_write_close(); //ini_set("output_buffering", 0); //Download file //send file length info header('Content-Length:' . strlen($pdf)); //content type forcing dowlad header("Content-type: application/download\n"); //cache control header("Cache-control: private"); //sending creation time header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); //content type header('Content-Disposition: attachment; filename="' . $name . '.pdf"'); echo $pdf; exit; }