本文整理汇总了PHP中language类的典型用法代码示例。如果您正苦于以下问题:PHP language类的具体用法?PHP language怎么用?PHP language使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了language类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$tpl = new template();
$language = new language();
$language->setModule('leads');
$language->readIni();
if (isset($_POST['save'])) {
if (isset($_POST['name']) && isset($_POST['money']) && isset($_POST['referralSource'])) {
$refValue = '';
if ($_POST['referralValueOther'] != '') {
$refValue = $_POST['referralValueOther'];
} else {
if ($_POST['referralSource'] == 5 && $_POST['referralValueClient'] > 0) {
$refValue = $_POST['referralValueClient'];
}
}
$values = array('name' => $_POST['name'], 'refSource' => $_POST['referralSource'], 'refValue' => $refValue, 'potentialMoney' => $_POST['money'], 'creatorId' => $_SESSION['userdata']['id']);
$contact = array('name' => $_POST['clientName'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'email' => $_POST['email'], 'internet' => $_POST['internet']);
if ($this->isLead($values['name']) !== true) {
$leadId = $this->addLead($values);
$this->addLeadContact($contact, $leadId);
$tpl->setNotification('EDIT_SUCCESS', 'success');
} else {
$tpl->setNotification('LEAD_EXISTS', 'error');
}
} else {
$tpl->setNotification('MISSING_FIELDS', 'error');
}
}
$client = new clients();
$tpl->assign('referralSources', $this->getReferralSources());
$tpl->assign('clients', $client->getAll());
$tpl->display('leads.addLead');
}
示例2: getAll
public function getAll($notifyId = 0)
{
if ($notifyId == 0) {
$notifyId = $this->getMaxId();
$notifyId++;
}
$notifications = array("error" => false, "error_code" => ERROR_SUCCESS, "notifyId" => $notifyId, "notifications" => array());
$stmt = $this->db->prepare("SELECT * FROM notifications WHERE notifyToId = (:notifyToId) AND id < (:notifyId) ORDER BY id DESC LIMIT 20");
$stmt->bindParam(':notifyToId', $this->requestFrom, PDO::PARAM_INT);
$stmt->bindParam(':notifyId', $notifyId, PDO::PARAM_INT);
if ($stmt->execute()) {
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch()) {
$time = new language($this->db, $this->language);
if ($row['notifyFromId'] == 0) {
$profileInfo = array("id" => 0, "state" => 0, "username" => "", "fullname" => "", "lowPhotoUrl" => "/img/profile_default_photo.png");
} else {
$profile = new profile($this->db, $row['notifyFromId']);
$profileInfo = $profile->get();
unset($profile);
}
$data = array("id" => $row['id'], "type" => $row['notifyType'], "itemId" => $row['itemId'], "fromUserId" => $profileInfo['id'], "fromUserState" => $profileInfo['state'], "fromUserUsername" => $profileInfo['username'], "fromUserFullname" => $profileInfo['fullname'], "fromUserPhotoUrl" => $profileInfo['lowPhotoUrl'], "createAt" => $row['createAt'], "timeAgo" => $time->timeAgo($row['createAt']));
array_push($notifications['notifications'], $data);
$notifications['notifyId'] = $row['id'];
unset($data);
}
}
}
return $notifications;
}
示例3: fetchProduct
/**
* Fetches the product and adds it as an article to the klarna class. No need to return any data.
* Articles need to be set for fraud purpose, incorrect article means no_risk invoice. Hereby klarna will not take any risks.
*
* @param mixed $mProductId The product identified. Either int or string. Adapted according shop functionality
* @param Klarna $oKlarna The Klarna class object. Used to set any articles
* @return void
*/
protected function fetchProduct($mProductId)
{
global $currencies, $currency;
include DIR_WS_CLASSES . 'language.php';
$lng = new language();
if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
$lng->set_language($HTTP_GET_VARS['language']);
} else {
$lng->get_browser_language();
}
$language = $lng->language['directory'];
$languages_id = $lng->language['id'];
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int) $mProductId . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'");
$aProduct_info = tep_db_fetch_array($product_info_query);
$sArtNo = MODULE_PAYMENT_KLARNA_ARTNO == 'id' || MODULE_PAYMENT_KLARNA_ARTNO == '' ? $aProduct_info['id'] : $aProduct_info['name'];
$iTax = tep_get_tax_rate($aProduct_info['products_tax_class_id']);
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$iPrice_with_tax = $currencies->get_value($currency) * $aProduct_info['products_price'];
} else {
$iPrice_with_tax = $currencies->get_value($currency) * $aProduct_info['products_price'] * ($iTax / 100 + 1);
}
// Add goods
$this->oKlarna->addArticle(1, $sArtNo, $aProduct_info['products_name'], $iPrice_with_tax, $iTax, 0, KlarnaFlags::INC_VAT);
$this->iSum += $iPrice_with_tax;
}
示例4: getRightListSub
private static function getRightListSub($rights, $setRights, $rid, $modul, $modul_name, $template, $RIGHT)
{
$str = '';
reset($rights);
while (list($key, $val) = each($rights)) {
if ($val['mr_parent_id'] == $rid && $val['mr_mod_id'] == $modul) {
$tmp = self::getRightListSub($rights, $setRights, $val['mr_id'], $modul, $modul_name, $template, $RIGHT);
if (!empty($setRights) && array_key_exists($val['mr_id'], $setRights)) {
$checked = 'checked';
$value = $setRights[$val['mr_id']];
} else {
$checked = '';
$value = 0;
}
page::assign("subright", $tmp);
page::assign("right", $val['mr_name']);
page::assign("right_id", $val['mr_id']);
page::assign("checked", $checked);
page::assign("value", $value);
$pos = strpos($val['mr_name'], ' ');
if ($pos) {
$lang_id = substr($val['mr_name'], 0, $pos);
$domain_id = substr($val['mr_name'], $pos + 1, strlen($val['mr_name']) - $pos);
$domain = new domain($domain_id);
$lang = new language($lang_id);
page::assign("right_name", $domain->getName() . ' (' . $lang->getName() . ')');
} else {
$right_name = isset($RIGHT[$modul_name][$val['mr_name']]) ? $RIGHT[$modul_name][$val['mr_name']] : $val['mr_name'];
page::assign("right_name", $right_name);
}
$str .= page::parse($template);
}
}
return $str;
}
示例5: listAvailableOrderingsForAdmin
function listAvailableOrderingsForAdmin(&$config)
{
$this->init();
$this->lang->init($GLOBALS['BE_USER']->uc['lang']);
// get orderings
$fieldLabel = $this->lang->sL('LLL:EXT:ke_search/locallang_db.php:tx_kesearch_index.relevance');
$notAllowedFields = 'uid,pid,tstamp,crdate,cruser_id,starttime,endtime,fe_group,targetpid,content,params,type,tags,abstract,language,orig_uid,orig_pid,hash';
if (!$config['config']['relevanceNotAllowed']) {
$config['items'][] = array($fieldLabel . ' UP', 'score asc');
$config['items'][] = array($fieldLabel . ' DOWN', 'score desc');
}
$res = $GLOBALS['TYPO3_DB']->sql_query('SHOW COLUMNS FROM tx_kesearch_index');
while ($col = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (TYPO3_VERSION_INTEGER >= 7000000) {
$isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']);
} else {
$isInList = t3lib_div::inList($notAllowedFields, $col['Field']);
}
if (!$isInList) {
$file = $GLOBALS['TCA']['tx_kesearch_index']['columns'][$col['Field']]['label'];
$fieldLabel = $this->lang->sL($file);
$config['items'][] = array($fieldLabel . ' UP', $col['Field'] . ' asc');
$config['items'][] = array($fieldLabel . ' DOWN', $col['Field'] . ' desc');
}
}
}
示例6: getSiteLanguage
function getSiteLanguage($get = null)
{
$default = array('dir' => 'dutch', 'id' => '1', 'code' => 'nl');
if (!tep_session_is_registered('language') || isset($_GET['language'])) {
if (!tep_session_is_registered('language')) {
tep_session_register('language');
tep_session_register('languages_id');
tep_session_register('languages_code');
}
include DIR_WS_CLASSES . 'language.php';
$lng = new language();
if (isset($_GET['language']) && tep_not_null($_GET['language'])) {
$lng->set_language($_GET['language']);
} else {
$lng->get_browser_language();
if (empty($lng)) {
$lng->set_language(DEFAULT_LANGUAGE);
}
}
$default = array('dir' => $lng->language['directory'], 'id' => $lng->language['id'], 'code' => $lng->language['code']);
}
if ($get && isset($default[$get])) {
return $default[$get];
}
return $default;
}
示例7: __construct
public function __construct()
{
$this->BASE_FILE = ROOT_URL . 'Membre.php';
$this->lng = language::getinstance()->GetLngBlock('membre');
parent::__construct();
$this->page_title = $this->lng['page_title'];
}
示例8: __construct
public function __construct()
{
$this->BASE_FILE = ROOT_URL . 'pillage.php';
$this->ress = DataEngine::a_ressources();
$this->lng = language::getinstance()->GetLngBlock('pillage');
parent::__construct();
}
示例9: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$containers = array();
$containerClassFiles = scandir(\base_config::$baseDir . '/inc/dashcontainers/');
foreach ($containerClassFiles as $containerClassFile) {
if (strpos($containerClassFile, '.php') === false) {
continue;
}
$containerClassFile = str_replace('.php', '', $containerClassFile);
$containerObject = new $containerClassFile($this);
if (is_a($containerObject, '\\interfaces\\dashcontainer')) {
$containerPosition = $containerObject->getPosition();
if (isset($containers[$containerPosition])) {
$containerPosition++;
}
$containers[$containerPosition] = new \model\dashboard_container($containerObject->getBoxName(), $containerObject->getBoxHeadline(), $containerObject->getBoxContent(), $containerObject->getSize(), $containerObject->getHeight());
} else {
$message = \language::replaceLanguageConstant(\language::returnLanguageConstant('DASH_CONTAINER_INSTANCE'), array('{{dashcontainer}}' => $containerClassFile));
\messages::registerError($message);
}
}
if (count($containers) >= 1) {
ksort($containers);
}
$view = new \model\view_acp('dashboard');
$view->assign('statsContainers', $containers);
$view->render();
}
示例10: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
if (!is_null($this->getRequestVar('affiliateDelList'))) {
$affiliateIds = $this->getRequestVar('affiliateDelList');
foreach ($affiliateIds as $affiliateId) {
$affiliate = new \model\affiliate($this->getDbconnection(), $this->filterRequest($affiliateId, array(1, 4, 7)));
$affiliate->delete();
}
$this->redirect('affiliate/list', array('affiliatedeleted=yes'));
}
$affiliateList = new \model\affiliate_list($this->getDbconnection());
$affiliateList->setGroupByCategory(true);
if (!is_null($this->getRequestVar('affiliateadded'))) {
\messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_ADDAFFILIATE'));
}
if (!is_null($this->getRequestVar('affiliateedited'))) {
\messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_EDITAFFILIATE'));
}
if (!is_null($this->getRequestVar('affiliatedeleted'))) {
\messages::registerMessage(\language::returnLanguageConstant('DELETE_SUCCESS_AFFILIATES'));
}
$view = new \model\view_acp('affiliate_list');
$view->assign('theList', $affiliateList->getAffiliates());
$view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
$view->render();
}
示例11: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$category = new \model\category($this->getDbconnection());
if (!is_null($this->getRequestVar('submupload'))) {
$newFile = new \model\file();
$icon = $newFile->uploadFile();
$category->setIconPath($icon);
}
if (!is_null($this->getRequestVar('category'))) {
$data = $this->getRequestVar('category');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$category->setName($data['name']);
$category->setIconPath($data['iconPath']);
$category->setIsPrivate($data['isPrivate']);
if ($category->save()) {
$this->redirect('category/list', array('categoryadded=yes'));
} else {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
}
} else {
$category->setIsPrivate(0);
}
$view = new \model\view_acp('category_editor');
$view->assign('category', $category);
$view->assign('editormode', 0);
$view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_ADD'));
$view->render();
}
示例12: __construct
public function __construct()
{
parent::__construct();
$lng = language::getinstance()->GetLngBlock('dataengine');
$this->CronPattern = $lng['wormholes_cron'];
$this->lastrun = DataEngine::config_key('wormhole_cleaning', 'lastrun');
}
示例13: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$categoryId = $this->getRequestVar('categoryid', array(1, 4, 7));
if (is_null($categoryId)) {
$this->redirect('category/list');
}
$category = new \model\category($this->getDbconnection(), $categoryId);
if (!is_null($this->getRequestVar('category'))) {
$data = $this->getRequestVar('category');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$category->setName($data['name']);
$category->setIconPath($data['iconPath']);
$category->setIsPrivate($data['isPrivate']);
if ($category->update()) {
$this->redirect('category/list', array('categoryedited=yes'));
} else {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
}
}
$view = new \model\view_acp('category_editor');
$view->assign('category', $category);
$view->assign('editormode', 1);
$view->assign('systemmode', $this->getSysconfig()->getSystemMode());
$view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_EDIT'));
$view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
$view->render();
}
示例14: __construct
public function __construct()
{
$this->BASE_FILE = ROOT_URL . "Carte.php";
$this->map = map::getinstance();
$this->lng = language::getinstance()->GetLngBlock('carte');
parent::__construct();
}
示例15: runUpdate
public function runUpdate($fileList = array())
{
$view = new \model\view_installer('updater');
$view->assign('version', $this->sysconfig->getSysVersion());
include \base_config::$baseDir . '/version.php';
$this->updateConfigKey('sysVersion', $afltrVersion);
if (file_exists(\base_config::$updateCache)) {
@unlink(\base_config::$updateCache);
}
$fileDeleteList = array('/inc/model/model_base.php', '/inc/model/dashcontainerbox.php', '/inc/lib/jquery/jquery-1.10.2.min.js');
foreach ($fileDeleteList as $fileDelete) {
if (file_exists(\base_config::$baseDir . $fileDelete)) {
@unlink(\base_config::$baseDir . $fileDelete);
}
}
$file = new \model\file();
if (is_dir(base_config::$baseDir . '/inc/lib/lightbox')) {
$file->deleteRecursive(base_config::$baseDir . '/inc/lib/lightbox');
}
if (is_dir(base_config::$baseDir . '/inc/lib/jquery_ui')) {
$file->deleteRecursive(base_config::$baseDir . '/inc/lib/jquery_ui');
}
if (!file_exists(base_config::$uploadDir . '/banners')) {
mkdir(base_config::$uploadDir . '/banners');
}
$this->createConfigKey('timeZone', 'Europe/Berlin');
$newVersion = $this->dbconnection->select("config", "config_value", "config_key LIKE 'sysVersion'");
\messages::registerMessage(\language::returnLanguageConstant('UPDATE_SUCCESS'), true);
$view->assign('newVersion', $newVersion[0]['config_value']);
$view->assign('fileList', $fileList);
$view->render();
}