Exemple #1
0
 /**
  * one action Index
  * for show and update userinfo
  */
 public function actionIndex()
 {
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         Module::getTable('UserInfo');
         $usersTable = new UserInfo();
         if (isset($_POST['firstname'])) {
             echo $_POST['surname'];
             // save user's additional info
             $userInfo['uid'] = $_SESSION['uid'];
             $userInfo['firstname'] = isset($_POST['firstname']) ? $_POST['firstname'] : ' ';
             $userInfo['surname'] = isset($_POST['surname']) ? $_POST['surname'] : ' ';
             $userInfo['website'] = isset($_POST['website']) ? $_POST['website'] : ' ';
             $userInfo['imageurl'] = isset($_POST['imageurl']) ? $_POST['imageurl'] : ' ';
             $usersTable->addUserInfo($userInfo);
             header("Location: " . $_SERVER['HTTP_REFERER']);
         }
     }
     Module::getTable('UserInfo');
     $usersTable = new UserInfo();
     $where = 'users.id = ' . $_SESSION['uid'];
     $translator = new translate();
     $data = $usersTable->fetchByCond($where);
     $data['lang'] = $translator->getVocab($_SESSION['lang']);
     $this->view->generate('InfoView.php', 'TemplateView.php', $data);
 }
Exemple #2
0
 /**
  * Action for change language
  */
 public function actionlangchange()
 {
     $translator = new translate();
     $langs = $translator->getLangs();
     $currentPos = array_search($_SESSION['lang'], $langs);
     if ($currentPos == count($langs) - 1) {
         $_SESSION['lang'] = $langs[0];
     } else {
         $_SESSION['lang'] = next($langs);
     }
     header("Location: http://" . $_SERVER['HTTP_HOST'] . "/");
 }
 private function responseMsgWX($postObj)
 {
     $fromUsername = $postObj->FromUserName;
     $toUsername = $postObj->ToUserName;
     $keyword = trim($postObj->Content);
     $time = time();
     $textTpl = "<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>";
     if (!empty($keyword)) {
         $msgType = "text";
         //$contentStr = "Welcome to wechat world!";
         //$contentStr = $keyword;
         // $contentStr = $this->baiduTran($keyword);
         $translateOBJ = new translate();
         $contentStr = $translateOBJ->youdaoTran($keyword);
         $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);
         echo $resultStr;
     } else {
         echo "Must Input something...";
     }
 }
Exemple #4
0
 /**
  * action for registration
  */
 public function actionRegister()
 {
     $translator = new translate();
     $data['lang'] = $translator->getVocab($_SESSION['lang']);
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $formIsValid = false;
         // validate entered data
         if (isset($_POST['login']) && isset($_POST['email']) && isset($_POST['password']) && isset($_POST['passwordretype'])) {
             if ($_POST['login'] != '' && $_POST['email'] != '' && $_POST['password'] != '' && $_POST['passwordretype'] != '' && $_POST['password'] == $_POST['passwordretype'] && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
                 // на всякий случай
                 // для безопасности не критично, но эта строковая константа используется в системе
                 if ($_POST['login'] == 'Anonimous') {
                     $formIsValid = false;
                 } else {
                     $formIsValid = true;
                 }
             }
         }
         if (!$formIsValid) {
             $data['login'] = $_POST['login'];
             $data['email'] = $_POST['email'];
             $data['errors'] = $data['lang']['errors'];
             $this->view->generate('RegisterView.php', 'TemplateView.php', $data);
         }
         // insert new user into table
         Module::getTable('Users');
         $usersTable = new Users();
         $password = md5($_POST['password']);
         $result = $usersTable->appendNewUser($_POST['login'], $password, session_id(), $_POST['email']);
         if ($result) {
             $_SESSION['sid'] = session_id();
             define('SID', session_id());
             header("Location: http://" . $_SERVER['HTTP_HOST'] . "/auth");
         } else {
             // something goes wrong, it's possible user already exist
             $data['userexist'] = $data['lang']['username'] . ' ' . $_POST['login'] . ' ' . $data['lang']['registered'];
         }
     }
     $this->view->generate('RegisterView.php', 'TemplateView.php', $data);
 }
 static function setUpTranslationConstants()
 {
     if (!defined("SITE_CONFIG_SITE_LANGUAGE")) {
         define("SITE_CONFIG_SITE_LANGUAGE", "English (en)");
     }
     $db = Database::getDatabase();
     $languageId = $db->getValue("SELECT id FROM language WHERE languageName = " . $db->quote(SITE_CONFIG_SITE_LANGUAGE));
     if (!(int) $languageId) {
         return false;
     }
     translate::updateAllLanguageContent($languageId);
     /* load in the content */
     $rows = $db->getRows("SELECT language_key.languageKey, language_content.content FROM language_content LEFT JOIN language_key ON language_content.languageKeyId = language_key.id WHERE language_content.languageId = " . (int) $languageId);
     if (COUNT($rows)) {
         foreach ($rows as $row) {
             $constantName = "LANGUAGE_" . strtoupper($row['languageKey']);
             define($constantName, $row['content']);
         }
     }
 }
    $_REQUEST = fix_slashes($_REQUEST);
    $_COOKIE = fix_slashes($_COOKIE);
}
// Load our config settings
$Config = Config::getConfig();
/* load db config settings into constants */
$db = Database::getDatabase();
$rows = $db->getRows("SELECT config_key, config_value FROM site_config ORDER BY config_group, config_key");
if (COUNT($rows)) {
    foreach ($rows as $row) {
        $constantName = "SITE_CONFIG_" . strtoupper($row['config_key']);
        define($constantName, $row['config_value']);
    }
}
/* setup translations */
translate::setUpTranslationConstants();
// Store session info in the database?
if ($Config->useDBSessions === true) {
    DBSession::register();
}
// Initialize our session
session_name($Config->sessionName);
session_start();
// Initialize current user
$Auth = Auth::getAuth();
// Object for tracking and displaying error messages
$Error = Error::getError();
define("SITE_IMAGE_PATH", WEB_ROOT . "/themes/" . SITE_CONFIG_SITE_THEME . "/images");
define("SITE_CSS_PATH", WEB_ROOT . "/themes/" . SITE_CONFIG_SITE_THEME . "/styles");
define("SITE_JS_PATH", WEB_ROOT . "/themes/" . SITE_CONFIG_SITE_THEME . "/js");
/* check for banned ip */
 function t($message, $style, $resource_name, $line, $plural = '', $count = 1, $lang = null)
 {
     global $opt;
     if ($message == '') {
         return '';
     }
     if ($message == 'INTERNAL_LANG') {
         return parent::t($message, $style, $resource_name, $line, $plural, $count);
     }
     if ($plural != '' && $count != 1) {
         $message = $plural;
     }
     $search = $this->prepare_text($message);
     $language = $opt['template']['locale'];
     if (!isset($language)) {
         global $locale;
         $language = $locale;
     }
     $rs = sql("SELECT `sys_trans`.`id` , `sys_trans_text`.`text` FROM `sys_trans` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id` = `sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang` = '&1' WHERE `sys_trans`.`text` = '&2'", $language, $search);
     $r = sql_fetch_assoc($rs);
     $trans = $r['text'];
     $trans = $this->v($trans);
     if ($trans && !$this->editAll) {
         return $trans;
     }
     if (empty($r['id'])) {
         global $translationHandler;
         if (empty($resource_name)) {
             $backtrace = debug_backtrace();
             $item = $backtrace[$this->backtrace_level];
             $resource_name = $item['file'];
             $line = $item['line'];
         }
         $translationHandler->addText($search, $resource_name, $line);
         return $this->t($message, $style, $resource_name, $line, $plural, $count);
     }
     $text = $trans ? $trans : gettext($search);
     return $text . ' <a href= translate.php?action=edit&id=' . $r['id'] . '>Edit</a>';
 }
function t($key, $defaultContent = '')
{
    return translate::getTranslation($key, $defaultContent);
}
<?php

require_once dirname(__FILE__) . "/../../../../../core/php/core.inc.php";
include_file('core', 'authentification', 'php');
if (!isConnect()) {
    echo '<div class="alert alert-danger div_alert">';
    echo translate::exec('401 - Accès non autorisé');
    echo '</div>';
    die;
}
?>
<legend>Mémoires du clavier</legend>
<div class="alert alert-info">
            Info : <br/>
            - Ce tableau vous permet de visualiser les mémoires occupées sur votre clavier<br/>
			- Pour enregistrer un nouveau code cliquez sur le bouton Vert sur la mémoire désirée et suivez les étapes<br/>
			- Le zipato ne permet pas de supprimer une mémoire, cependant vous pouvez remplacer le code d'une mémoire exsitante<br/>
			- Il est impossible d'enregistrer le même code/badge sur deux mémoires différentes<br/>
			- Il est est impossible (par mesure de sécurité) de lire la valeur d'un code enregistré<br/>
			- Pour vider toutes vos mémoires, vous pouvez exclure et inclure le module<br/>
        </div>
<table class="table table-condensed table-bordered">
	<thead>
		<tr>
			<th>1</th>
			<th>2</th>
			<th>3</th>
			<th>4</th>
			<th>5</th>
			<th>6</th>
			<th>7</th>
Exemple #10
0
 *
 * Jeedom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
require_once dirname(__FILE__) . "/core.inc.php";
$file = dirname(__FILE__) . "/../../" . init('file');
$pathinfo = pathinfo($file);
if ($pathinfo['extension'] != 'js') {
    die;
}
if (file_exists($file)) {
    header('Content-Type: application/javascript');
    $lastModified = filemtime($file);
    $etagFile = md5_file($file);
    $ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false;
    $etagHeader = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false;
    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModified) . " GMT");
    header("Etag: {$etagFile}");
    header('Cache-Control: public');
    if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModified || $etagHeader == $etagFile) {
        header("HTTP/1.1 304 Not Modified");
        exit;
    }
    echo translate::exec(file_get_contents($file), init('file'), true);
    exit;
}
 public static function convertCondition($_condition)
 {
     if (translate::getLanguage() == 'fr_FR') {
         switch ($_condition) {
             case 'AM Drizzle':
                 return 'Avec Bruine le matin';
             case 'Drizzle':
                 return 'Avec Bruine';
             case 'Showers Early':
                 return 'Peu nuageux';
             case 'PM Sun':
                 return 'Ensoleillé l\'après-midi';
             case 'AM Rain':
                 return 'Pluvieux le matin';
             case 'PM Rain':
                 return 'Pluvieux l\'après-midi';
             case 'PM Clouds':
                 return 'Nuageux l\'après-midi';
             case 'PM Showers':
                 return 'Pluvieux l\'après-midi';
             case 'PM Light Rain':
                 return 'Legèrement pluvieux l\'après-midi';
             case 'PM Thunderstorms':
                 return 'Orageux l\'aprés-midi';
             case 'AM Thunderstorms':
                 return 'Orageux le matin';
             case 'PM Thunderstorms/Wind':
                 return 'Orageux et venteux l\'aprés-midi';
             case 'AM Thunderstorms/Wind':
                 return 'Orageux et venteux le matin';
             case 'Thunderstorms/Wind':
                 return 'Orageux et venteux';
             case 'AM Sun':
                 return 'Ensoleillé le matin';
             case 'AM Clouds':
                 return 'Nuageux le matin';
             case 'AM Clouds/PM Sun':
                 return 'Nuageux le matin/Ensoleillé l\'après-midi';
             case 'AM Fog/PM Sun':
                 return 'Brumeux le matin/Ensoleillé l\'après-midi';
             case 'Rain/Wind':
                 return 'Pluvieux et venteux';
             case 'AM Sun/PM Clouds':
                 return 'Ensoleillé le matin/Nuageux l\'après-midi';
             case 'Clouds Early/Clearing Late':
                 return 'Nuageux tôt et eclaircie tardive';
             case 'Partly Cloudy':
                 return 'Partiellement nuageux';
             case 'Mostly Cloudy':
                 return 'Nuageux';
             case 'Cloudy':
                 return 'Nuageux';
             case 'AM Showers/Wind':
                 return 'Venteux et pluvieux le matin';
             case 'PM Showers/Wind':
                 return 'Venteux et pluvieux l\'après-midi';
             case 'Partly Cloudy/Wind':
                 return 'Partiellement nuageux et venteux';
             case 'Fair/Windy':
                 return 'Venteux';
             case 'Sunny':
                 return 'Ensoleillé';
             case 'Mostly Sunny':
                 return 'Plutôt ensoleillé';
             case 'Fair':
                 return 'Beau';
             case 'Clear':
                 return 'Dégagé';
             case 'Mostly Clear':
                 return 'Dégagé';
             case 'Showers':
                 return 'Avec des Averses';
             case 'Few showers':
                 return 'Avec quelques averses';
             case 'Showers/Wind':
                 return 'Averses et vent';
             case 'Light Rain':
                 return 'Faiblement pluvieux';
             case 'Rain':
                 return 'Pluvieux';
             case 'Fog':
                 return 'Brumeux';
             case 'Partial Fog':
                 return 'Partiellement brumeux';
             case 'AM Fog/PM Clouds':
                 return 'Brumeux le matin et nuageux l\'après-midi';
             case 'Scattered Showers':
                 return 'Peu nuageux';
             case 'AM Showers':
                 return 'Pluvieux l\'après-midi';
             case 'PM Tunderstorms':
                 return 'Orageux l\'après-midi';
             case 'Light Rain with Thunder':
                 return 'Légèrement pluvieux avec orage';
             case 'Thunder':
                 return 'Orageux';
             case 'Scattered Thunderstorms':
                 return 'Orageux';
             case 'Heavy Rain':
                 return 'Fortement pluvieux';
             case 'Rain Shower':
                 return 'Pluvieux';
             case 'Showers Late':
                 return 'Avec Averses tardive';
             case 'Showers in the Vicinity':
                 return 'Avec Averses localisées';
             case 'Light Rain Shower':
                 return 'légèrement pluvieux';
             case 'Light Drizzle':
                 return 'Brumeux';
             case 'Thunder in the Vicinity':
                 return 'Orageux localement';
             case 'AM Little Rain':
                 return 'Légèrement pluvieux le matin';
             case 'AM Light Rain':
                 return 'Légèrement pluvieux le matin';
             case 'Thunderstorms':
                 return 'Orageux';
             case 'Thunderstorm':
                 return 'Orageux';
             case 'Thundershowers':
                 return 'Averses orageuses';
             case 'Rain/Thunder':
                 return 'Pluvieux/Orageux';
             case 'Isolated Thunderstorms':
                 return 'Orageux localement';
             case 'Scattered Thunderstorms/Wind':
                 return 'Avec Orage dispersé et venteux';
             case 'Light Rain/Wind':
                 return 'Légèrement pluvieux et venteux';
             case 'Thunderstorms Early':
                 return 'Orageux';
             case 'Cloudy/Wind':
                 return 'Nuageux et venteux';
             case 'Rain late':
                 return 'Pluvieux tardivement';
             case 'PM Light Rain/Wind':
                 return 'Légèrement pluvieux et vent';
             case 'Showers Late':
                 return 'Tardivement pluvieux';
             case 'Rain Early':
                 return 'Pluvieux';
             case 'Mostly Clear/Wind':
                 return 'Dégagé et venteux';
             case 'Sunny/Wind':
                 return 'Ensoleillé et venteux';
             case 'Rain early':
                 return 'Pluvieux';
             case 'Light Rain/Fog':
                 return 'Faiblement pluvieux et brumeux';
             case 'Light Rain Early':
                 return 'Pluvieux le matin';
             case 'Mostly Sunny/Wind':
                 return 'Ensoleillé avec du vent';
             case 'Mist':
                 return 'Brumeux';
             case 'Rain/Windy':
                 return 'Pluvieux et venteux';
             case 'Light Rain/Windy ':
                 return 'Faiblement pluvieux et venteux';
             case 'Mostly Cloudy/Windy':
                 return 'Nuageux avec du vent';
             case 'Cloudy/Windy':
                 return 'Nuageux et venteux';
             case 'Light Snow':
                 return 'Faiblement neigeux';
             case 'Partly Cloudy/Windy':
                 return 'Partiellement nuageux et venteux';
             case 'Heavy Drizzle':
                 return 'Brumeux';
             case 'Light Rain Late':
                 return 'Légèrement pluvieux dans la soirée';
             case 'AM Rain/Snow':
                 return 'Pluvieux et neigeux le matin';
             case 'Rain/Snow':
                 return 'Pluvieux et neigeux';
             case 'PM Rain/Wind':
                 return 'Pluvieux et venteux l\'après midi';
             case 'Rain/Snow Late':
                 return 'Pluvieux et neigeux plus tard';
             case 'Rain/Snow Showers':
                 return 'Pluvieux et neigeux';
             case 'Shallow Fog':
                 return 'Faiblement pluvieux';
             case 'Rain and Snow':
                 return 'Pluvieux et neigeux';
             case 'Light Drizzle/Windy':
                 return 'Légèrement brumeux et venteux';
             case 'Sleet':
                 return 'Neigeux';
             case 'Snow':
                 return 'Neigeux';
             case 'Showers Late':
                 return 'Pluvieux dans la soirée';
             case 'PM Snow Showers':
                 return 'Neigeux l\'après midi';
             case 'Light Rain/Windy':
                 return 'Légèrement pluvieux et venteux';
             case 'Haze':
                 return 'Brumeux';
             case 'Heavy Rain/Wind':
                 return 'Fortement pluvieux et venteux';
             case 'AM Light Rain/Wind':
                 return 'Pluvieux et venteux le matin';
             default:
                 return $_condition;
         }
     }
     return $_condition;
 }
Exemple #12
0
						<tr>
							<td>From:<br>' . $from . '</td>
							<td>To:<br>' . $to . '</td>
						</tr>
						<tr>
							<td colspan="2"><input type="text" value="' . $_POST['word'] . '" name="word" style="width: 335px;" /></td>
						</tr>
						<tr>
							<td colspan="2"><input type="submit" value="Translate" name="submit" /></td>
						</tr>
					</table>
				</form>';
    $pre = 1;
} else {
    require_once "class.translate.php";
    $var = new translate("en", "it");
    $content = $var->get("hello mister");
    $content = '<form action="" method="post">
					<table>
						<tr>
							<td>From:<select name="from">
									<option value=af >Afrikaans</option>
									<option value=sq>Albanian</option>
									<option value=ar>Arabic</option>
									<option value=az>Azerbaijani</option>
									<option value=eu>Basque</option>
									<option value=bn>Bengali</option>
									<option value=be>Belarusian</option>
									<option value=bg>Bulgarian</option>
									<option value=ca>Catalan</option>
									<option value=zh-CN>Chinese Simplified</option>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><?php 
echo t("admin_panel", "Admin Panel");
?>
</title>
	
	<!-- YUI -->
	<script type="text/javascript" src="js/yui_combo.js"></script>
	<!-- http://developer.yahoo.com/yui/articles/hosting/?animation&base&button&connection&connectioncore&container&containercore&datasource&datatable&dom&dragdrop&element&event&fonts&get&grids&json&layout&menu&paginator&reset&resize&tabview&treeview&utilities&yahoo-dom-event&yuiloader&yuiloader-dom-event&MIN -->

	<link rel="stylesheet" href="admin_screen.css" type="text/css" media="screen" title="Screen" charset="utf-8" />
	<link rel="stylesheet" type="text/css" href="combo_yui.css">
	
	<script>
		<?php 
echo translate::generateJSLanguageCode();
?>
	</script>
	
	<!-- inputEx -->
	<script type="text/javascript" src="../js/inputex-0.2.2/js/inputex-loader.js"></script>
	<link  href="../js/inputex-0.2.2/css/inputEx.css" rel="stylesheet" type="text/css" />
	<script src="../js/inputex-0.2.2/js/inputex.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/Field.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/Group.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/Form.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/fields/StringField.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/fields/CheckBox.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/fields/EmailField.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/fields/UrlField.js" type="text/javascript"></script>
	<script src="../js/inputex-0.2.2/js/fields/Textarea.js" type="text/javascript"></script>
Exemple #14
0
     if (isset($_GET['ajax']) && $_GET['ajax'] == 1) {
         include_file('core', 'authentification', 'php');
         try {
             if (!isConnect()) {
                 throw new Exception('{{401 - Accès non autorisé}}');
             }
             include_file('desktop', init('p'), 'php', init('m'));
         } catch (Exception $e) {
             $_folder = 'desktop/php';
             if (init('m') != '') {
                 $_folder = 'plugins/' . init('m') . '/' . $_folder;
             }
             ob_end_clean();
             //Clean pile after expetion (to prevent no-traduction)
             echo '<div class="alert alert-danger div_alert">';
             echo translate::exec(displayExeption($e), $_folder . '/' . init('modal') . '.php');
             echo '</div>';
         }
         die;
     } else {
         include_file('desktop', 'index', 'php');
         die;
     }
 } else {
     if ($_GET['v'] == "m") {
         if (isset($_GET['modal'])) {
             include_file('mobile', init('modal'), 'modal', init('plugin'));
         } else {
             if (isset($_GET['p']) && isset($_GET['ajax'])) {
                 if (isset($_GET['m'])) {
                     include_file('mobile', $_GET['p'], 'html', $_GET['m']);
Exemple #15
0
 /**
  * default action
  */
 function actionindex()
 {
     $translator = new translate();
     $data['lang'] = $translator->getVocab($_SESSION['lang']);
     $this->view->generate('404View.php', 'TemplateView.php');
 }
 public static function getExpressionOptions($_expression, $_options)
 {
     $startLoadTime = getmicrotime();
     $cmd = cmd::byId(str_replace('#', '', cmd::humanReadableToCmd($_expression)));
     if (is_object($cmd)) {
         $return['html'] = trim($cmd->toHtml('scenario', $_options));
     } else {
         try {
             $return['html'] = getTemplate('core', 'scenario', $_expression . '.default');
             if (is_json($_options)) {
                 $_options = json_decode($_options, true);
             }
             if (is_array($_options) && count($_options) > 0) {
                 foreach ($_options as $key => $value) {
                     $replace['#' . $key . '#'] = $value;
                 }
             }
             if (!isset($replace['#id#'])) {
                 $replace['#id#'] = rand();
             }
             $return['html'] = template_replace(cmd::cmdToHumanReadable($replace), $return['html']);
         } catch (Exception $e) {
         }
     }
     $replace = array('#uid#' => 'exp' . mt_rand());
     $return['html'] = translate::exec(template_replace($replace, $return['html']), 'core/template/scenario/' . $_expression . '.default');
     return $return;
 }
Exemple #17
0
function include_file($_folder, $_fn, $_type, $_plugin = '')
{
    $type = '';
    if ($_folder == '3rdparty') {
        $_folder = $_folder;
        $_fn = $_fn . '.' . $_type;
        $path = dirname(__FILE__) . "/../../{$_folder}/{$_fn}";
        if ($_type == 'css') {
            $type = 'css';
        } else {
            if ($_type == 'js') {
                $type = 'js';
            } else {
                $type = 'php';
            }
        }
    } else {
        if ($_type == 'class') {
            $_folder .= '/class';
            $_fn = $_fn . '.class.php';
            $type = 'php';
        }
        if ($_type == 'com') {
            $_folder .= '/com';
            $_fn = $_fn . '.com.php';
            $type = 'php';
        }
        if ($_type == 'config') {
            $_folder .= '/config';
            $_fn = $_fn . '.config.php';
            $type = 'php';
        }
        if ($_type == 'modal') {
            $_folder = $_folder . '/modal';
            $_fn = $_fn . '.php';
            $type = 'php';
        }
        if ($_type == 'php') {
            $_folder = $_folder . '/php';
            $_fn = $_fn . '.php';
            $type = 'php';
        }
        if ($_type == 'css') {
            $_folder = $_folder . '/css';
            $_fn = $_fn . '.css';
            $type = 'css';
        }
        if ($_type == 'js') {
            $_folder = $_folder . '/js';
            $_fn = $_fn . '.js';
            $type = 'js';
        }
        if ($_type == 'class.js') {
            $_folder = $_folder . '/js';
            $_fn = $_fn . '.class.js';
            $type = 'js';
        }
        if ($_type == 'custom.js') {
            $_folder = $_folder . '/custom';
            $_fn = $_fn . 'custom.js';
            $type = 'js';
        }
        if ($_type == 'custom.css') {
            $_folder = $_folder . '/custom';
            $_fn = $_fn . 'custom.css';
            $type = 'css';
        }
        if ($_type == 'api') {
            $_folder .= '/api';
            $_fn = $_fn . '.api.php';
            $type = 'php';
        }
        if ($_type == 'html') {
            $_folder .= '/html';
            $_fn = $_fn . '.html';
            $type = 'php';
        }
        if ($_type == 'configuration') {
            $_folder .= '';
            $_fn = $_fn . '.php';
            $type = 'php';
        }
    }
    if ($_plugin != '') {
        $_folder = 'plugins/' . $_plugin . '/' . $_folder;
    }
    $path = dirname(__FILE__) . "/../../{$_folder}/{$_fn}";
    if (file_exists($path)) {
        if ($type == 'php') {
            ob_start();
            require_once $path;
            echo translate::exec(ob_get_clean(), "{$_folder}/{$_fn}");
        } else {
            if ($type == 'css') {
                echo "<link href=\"{$_folder}/{$_fn}?md5=" . md5_file($path) . "\" rel=\"stylesheet\" />";
            } else {
                if ($type == 'js') {
                    echo "<script type=\"text/javascript\" src=\"core/php/getJS.php?file={$_folder}/{$_fn}&md5=" . md5_file($path) . "\"></script>";
                }
            }
        }
    } else {
        throw new Exception("File not found : {$_fn} at {$_folder} : {$path}", 35486);
    }
}
Exemple #18
0
function __($_content, $_name, $_backslash = false)
{
    return translate::sentence($_content, $_name, $_backslash = false);
}