本文整理汇总了PHP中text::get方法的典型用法代码示例。如果您正苦于以下问题:PHP text::get方法的具体用法?PHP text::get怎么用?PHP text::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类text
的用法示例。
在下文中一共展示了text::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* quickbox::__construct()
*
* @param array $init Initialization configuration
*
* Constructor which basically creates quickbox
* and readies it for doing things.
*/
public function __construct ($init)
{
# We need to include initialize the config class because it allows us to get and
# set configuration variables without using a global
require $init['quickbox/path'] . '/classes/core/config.class.php';
config::init($init);
define(DEBUG, config::get('debug'));
# Start a database connection
$this->db = new database();
try
{
$this->db->init();
} catch (Exception $e)
{
trigger_error(text::get('system/fatalError',$e->getMessage()), E_USER_ERROR);
}
require $init['quickbox/path'] . '/classes/core/metaclass.class.php';
metaclass::init($this->db);
# Put the post and get variables into a private for later use.
$_POST = $_POST;
$this->qbGet = $_GET;
# Start the session, giving it the database connection.
$this->qbSession = new session($this->db);
if ($this->qbGet['page'] == 'logout')
{
$this->qbSession->logout();
}
$this->qbSession->checkCookie();
if (strlen($_POST['user']) > 0 && $_POST['login'] == 1)
{
$this->qbErrors['login'] = $this->qbSession->login($_POST['user'], $_POST['password']);
}
$this->qbPage = ($_GET['page'] ? janitor::cleanData($_GET['page']) : 'home');
}
示例2: login
public function login ($user, $password)
{
$safeUser = janitor::cleanData($user, 'sql');
$query = new query();
$query->select()->from('userUsers')->joinLeft('userGroups', 'userUsers.group', 'id')->where('username', $user)->limit(
'1');
$result = $this->sDb->query($query);
if ($this->sDb->numRows($result) > 0)
{
$row = $this->sDb->assoc($result);
$safePassword = janitor::passwd($password, $row['salt']);
if ($safePassword['passwd'] == $row['password'])
{
$this->user = $user;
$this->userData = $row;
$this->setCookie($user, $row['email']);
$this->setSession($safeUser);
return false;
} else
{
return text::get('login/failedLogin');
}
} else
{
return text::get('login/failedLogin');
}
}
示例3: form
function form ($action, $method = 'post', $id = null, $invalid = false, $title = false, $submitted = false)
{
$this->header .= '<form action="' . $action . '" method="' . $method . '"' . ($id ? " id=\"$id\"" : null) . '><fieldset>';
if ($title)
{
$this->header .= '<h2>' . $title . '</h2>';
}
if ($submitted)
{
$this->header .= '<br/>';
if (count($invalid) > 0)
{
$this->header .= '<h6>' . text::get('validation/errorsProcessing') . '</h6><br/>';
foreach ($invalid as $k => $v)
{
$this->header .= '<p class="error">' . $v . '</p>';
}
} else
{
$this->header .= '<p class="success">' . text::get('validation/success') . '</p>';
}
}
$this->footer .= '
<p>
<button type="submit" class="button positive">
<img src="' . config::get(
'site/htmlRoot') . 'css/blueprint/plugins/buttons/icons/tick.png" alt="Save"/> ' . text::get('form/save') . '
</button>
<button type="reset" class="button negative">
<img src="' .
config::get('site/htmlRoot') . 'qbres/images/no.png" alt="Reset"/> ' . text::get(
'form/reset') . '
</button></p>
</fieldset></form>';
}
示例4: text
echo "access denied";
exit;
}
//get http post variables and set them to php variables
$reference_language = $_SESSION['domain']['language']['code'];
$target_language = check_str($_GET["target_language"]);
$app_target = 'resources';
if (count($_POST) > 0) {
//set the variables
$reference_language = check_str($_POST["reference_language"]);
$target_language = check_str($_POST["target_language"]);
$app_target = check_str($_POST["app_target"]);
}
//collect languages
$language = new text();
$language_text = $language->get('all', $app_target, true);
foreach ($language_text as $lang_label => $lang_codes) {
$language_labels[] = $lang_label;
$reference_text[$lang_label] = $lang_codes[$reference_language];
$target_text[$lang_label] = $lang_codes[$target_language];
}
sort($language_labels);
if ($app_target != 'resources') {
$global_text = $language->get($reference_language, 'resources', true);
}
unset($language_text);
//add multi-lingual support
$text = $language->get();
//get the list of installed apps from the core and mod directories
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
$app_list;
示例5: text
if (recording_audio.currentTime > 0) {
value = (100 / recording_audio.duration) * recording_audio.currentTime;
}
recording_progress.style.width = value + "%";
}
</script>
<!--{head}-->
</head>
<?php
//add multi-lingual support
$language = new text();
$text = $language->get(null, 'themes/default');
?>
<body onload="<?php
echo $onload;
?>
">
<div id='message_container' class='message_container_mood_default'></div>
<div id='message_text' class='message_container_text_default'></div>
<?php
//logged in show the domains block
if (strlen($_SESSION["username"]) > 0 && permission_exists("domain_select") && count($_SESSION['domains']) > 1) {
?>
<div id="domains_container">
示例6:
<hr class="space"/>
<div class="span-8 prepend-1 int_content">
<h1><?php echo text::get('auth/notAuthTitle') ?></h1>
<p><?php echo text::get('auth/notAuth') ?></p>
<?php
include $this->tplPathComponent('loginBox');
?>
</div>
示例7: query
/**
* database::query()
*
* @param string $query The query to be fed to the database.
* @return mixed Returns the result of the query.
*/
public function query ($query)
{
global $totalquery;
$totalquery++;
if ($result = mysql_query($query, $this->connection))
{
return $result;
} else
{
if (config::get('debug'))
{
$debugdata = debug_backtrace();
$debugData = $debugdata[0]['file'] . ', line ' . $debugdata[0]['line'];
}
trigger_error(
text::get('system/dbError') . (config::get('debug') ? ' ' . mysql_error() . '<br/>[ Called from: ' .
$debugData . ' ]<br/>' : null), E_USER_ERROR);
return false;
}
}
示例8: select
public function select()
{
//build the list of categories
$music_on_hold_dir = $_SESSION["switch"]["sounds"]["dir"] . "/music";
if (count($_SESSION['domains']) > 1) {
$music_on_hold_dir = $music_on_hold_dir . "/" . $_SESSION['domain_name'];
}
//add multi-lingual support
$language = new text();
$text = $language->get($_SESSION['domain']['language']['code'], 'app/music_on_hold');
//start the select
$select = "\t<select class='formfld' name='" . $this->select_name . "' id='" . $this->select_name . "' style='width: auto;'>\n";
$select .= "\t\t<option value='' style='font-style: italic;'>" . $text['opt-default'] . "</option>\n";
//categories
$array = glob($music_on_hold_dir . "/*/*", GLOB_ONLYDIR);
//list the categories
$moh_xml = "";
foreach ($array as $moh_dir) {
//set the directory
$moh_dir = substr($moh_dir, strlen($music_on_hold_dir . "/"));
//get and set the rate
$sub_array = explode("/", $moh_dir);
$moh_rate = end($sub_array);
//set the name
$moh_name = $moh_dir;
$moh_name = substr($moh_dir, 0, strlen($moh_name) - strlen($moh_rate));
$moh_name = rtrim($moh_name, "/");
if (count($_SESSION['domains']) > 1) {
$moh_value = "local_stream://" . $_SESSION['domain_name'] . "/" . $moh_name;
} else {
$moh_value = "local_stream://" . $moh_name;
}
$options[$moh_value] = str_replace('_', ' ', $moh_name);
}
if (sizeof($options) > 0) {
foreach ($options as $moh_value => $moh_name) {
$select .= "<option value='" . $moh_value . "' " . ($this->select_value == $moh_value ? 'selected="selected"' : null) . ">" . $moh_name . "</option>\n";
}
}
//recordings
$recordings_dir = $_SESSION['switch']['recordings']['dir'] . "/" . $_SESSION['domain_name'] . "/";
if ($dh = opendir($recordings_dir)) {
$tmp_selected = false;
$files = array();
//$select .= "<optgroup label='recordings'>\n";
while ($file = readdir($dh)) {
if ($file != "." && $file != ".." && $file[0] != '.') {
if (is_dir($recordings_dir . $file)) {
//this is a directory
} else {
if ($this->select_value == $recordings_dir . $file && strlen($this->select_value) > 0) {
$tmp_selected = true;
$select .= "\t\t<option value='" . $recordings_dir . $file . "' selected='selected'>" . $file . "</option>\n";
} else {
$select .= "\t\t<option value='" . $recordings_dir . $file . "'>" . $file . "</option>\n";
}
}
}
}
closedir($dh);
//$select .= "</optgroup>\n";
}
//add additional options
$select .= $this->select_options;
//end the select and return it
$select .= "\t</select>\n";
return $select;
}
示例9: text
recording_audio = document.getElementById('recording_audio_'+recording_id);
var recording_progress = document.getElementById('recording_progress_'+recording_id);
var value = 0;
if (recording_audio.currentTime > 0) {
value = (100 / recording_audio.duration) * recording_audio.currentTime;
}
recording_progress.style.width = value + "%";
}
</script>
</head>
<?php
//add multi-lingual support
$language = new text();
$text = $language->get(null, 'themes/minimized');
// set message_onload
if (strlen($_SESSION['message']) > 0) {
$message_text = addslashes($_SESSION['message']);
$message_mood = $_SESSION['message_mood'];
$message_delay = $_SESSION['message_delay'];
$onload .= "display_message('" . $message_text . "'";
$onload .= $message_mood != '' ? ", '" . $message_mood . "'" : ", 'default'";
if ($message_delay != '') {
$onload .= ", '" . $message_delay . "'";
}
$onload .= "); ";
unset($_SESSION['message'], $_SESSION['message_mood'], $_SESSION['message_delay']);
}
?>
示例10: get
public function get()
{
//add multi-lingual support
$language = new text();
$text = $language->get(null, 'app/music_on_hold');
//get moh records, build array
$sql = "select ";
$sql .= "d.domain_name, m.* ";
$sql .= "from v_music_on_hold as m ";
$sql .= "left join v_domains as d ON d.domain_uuid = m.domain_uuid ";
$sql .= "where (m.domain_uuid = '" . $this->domain_uuid . "' or m.domain_uuid is null) ";
$sql .= "order by m.domain_uuid desc, music_on_hold_rate asc, music_on_hold_name asc";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
return $prep_statement->fetchAll(PDO::FETCH_NAMED);
}
示例11: select
public function select($name, $selected)
{
//add multi-lingual support
$language = new text();
$text = $language->get();
//start the select
$select = "<select class='formfld' name='" . $name . "' id='" . $name . "' style='width: auto;'>\n";
//music list
if (count($this->music_list) > 0) {
$select .= "\t<optgroup label='" . $text['label-music_on_hold'] . "'>\n";
$previous_name = '';
foreach ($this->music_list as $row) {
if ($previous_name != $row['music_on_hold_name']) {
$name = '';
if (strlen($row['domain_uuid']) > 0) {
$name = $row['domain_name'] . '/';
}
$name .= $row['music_on_hold_name'];
$select .= "\t\t<option value='local_stream://" . $name . "' " . ($selected == "local_stream://" . $name ? 'selected="selected"' : null) . ">" . $row['music_on_hold_name'] . "</option>\n";
}
$previous_name = $row['music_on_hold_name'];
}
$select .= "\t</optgroup>\n";
}
//recordings
if (sizeof($this->recordings_list) > 0) {
$select .= "\t<optgroup label='" . $text['label-recordings'] . "'>";
foreach ($this->recordings_list as $recording_value => $recording_name) {
$select .= "\t\t<option value='" . $recording_value . "' " . ($selected == $recording_value ? 'selected="selected"' : '') . ">" . $recording_name . "</option>\n";
}
$select .= "\t</optgroup>\n";
}
//ringbacks
if (sizeof($this->ringbacks) > 0) {
$selected_ringback = $selected;
$selected_ringback = preg_replace('/\\A\\${/', "", $selected_ringback);
$selected_ringback = preg_replace('/}\\z/', "", $selected_ringback);
$select .= "\t<optgroup label='" . $text['label-ringback'] . "'>";
//$select .= " <option value='default_ringback'".(($selected == "default_ringback") ? ' selected="selected"' : '').">".$text['label-default']." (".$this->default_ringback_label.")</option>\n";
foreach ($this->ringbacks as $ringback_value => $ringback_name) {
$select .= "\t\t<option value='\${" . $ringback_value . "}'" . ($selected_ringback == $ringback_value ? ' selected="selected"' : '') . ">" . $ringback_name . "</option>\n";
}
$select .= "\t</optgroup>\n";
unset($selected_ringback);
}
//end the select and return it
$select .= "</select>\n";
return $select;
}
示例12:
<hr class="space"/>
<div class="span-8 prepend-1 int_content">
<h1><?php echo text::get('system/404title') ?></h1>
<p><?php echo text::get('system/404text') ?>.</p></div>
示例13: makeTable
public function makeTable ($fields = false)
{
if (! $fields)
{
$fields[] = 'id';
foreach ($this->definitions as $k => $v)
{
if ($v['ontable'])
{
$fields[] = $k;
}
if ($v['linkfield'])
{
$linkfield = $k;
}
}
}
$fields2['id'] = "ID";
foreach ($fields as $v)
{
$fields2[$v] = $this->definitions[$v]['title'];
}
$fields2['delete'] = "";
$table = new table($fields2, array (
'class' => 'span-16'
));
$fieldsList = metaclass::getItems($this->table, $fields, $this->keyField);
foreach ($fieldsList as $k => $v)
{
$v['delete'] = text::get('form/delete');
$table->addRow($v,
array (
$linkfield => array (
'type' => 'link' ,
'href' => $this->urlbase . '?id=' . $v['id']
) ,
'delete' => array (
'type' => 'link' ,
'href' => 'javascript:deleteitem(\'' . $v['id'] . '\',\'' . janitor::cleanData(
$v['title']) . '\',\'' . $this->urlbase . '\')'
)
));
}
return $table->output();
}
示例14: loadClass
/**
* Makes sure a class file is loaded. If it cannot, skip it. If it can, add it to the list of loaded classes.
* This doesn't return anything. It either loads the class and proceeds, sees the class is loaded and proceeds,
* or fails to find the class and throws an exception.
*
* @param string $class Name of the class.
* @param string $rel Extra path to the class, used for datatypes primarily.
*/
public static function loadClass ($class, $rel = null)
{
try
{
$classString = ($rel ? $rel . '/' : null) . $class;
if (! in_array($classString, metaclass::$classesLoaded))
{
$siteMetaPath = config::get('site/path') . '/metaclasses/' . ($rel ? $rel . '/' : null) . $class . '.class.php';
$quickboxMetaPath = config::get('quickbox/path') . '/metaclasses/' . ($rel ? $rel . '/' : null) . $class .
'.class.php';
$path = file_exists($siteMetaPath) ? $siteMetaPath : $quickboxMetaPath;
if (file_exists($path))
{
# Require the $class file path.
require_once $path;
metaclass::$classesLoaded[] = $classString;
} else
{
# If the class file is missing, we're fucked.
throw new Exception(text::get('metaclass/missingClassFile', $class));
}
}
} catch (Exception $e)
{
trigger_error($e->getMessage(), E_USER_ERROR);
}
}
示例15: select
/**
* Get the destination menu
* @var string $destination_type can be ivr, dialplan, call_center_contact or bridge
* @var string $destination_name - current name
* @var string $destination_value - current value
*/
public function select($destination_type, $destination_name, $destination_value)
{
//remove special characters from the name
$destination_id = str_replace("]", "", $destination_name);
$destination_id = str_replace("[", "_", $destination_id);
//add additional
if (if_group("superadmin")) {
$response = "<script>\n";
$response .= "var Objs;\n";
$response .= "\n";
$response .= "function changeToInput" . $destination_id . "(obj){\n";
$response .= "\ttb=document.createElement('INPUT');\n";
$response .= "\ttb.type='text';\n";
$response .= "\ttb.name=obj.name;\n";
$response .= "\ttb.className='formfld';\n";
$response .= "\ttb.setAttribute('id', '" . $destination_id . "');\n";
$response .= "\ttb.setAttribute('style', '" . $select_style . "');\n";
if ($onchange != '') {
$response .= "\ttb.setAttribute('onchange', \"" . $onchange . "\");\n";
$response .= "\ttb.setAttribute('onkeyup', \"" . $onchange . "\");\n";
}
$response .= "\ttb.value=obj.options[obj.selectedIndex].value;\n";
$response .= "\tdocument.getElementById('btn_select_to_input_" . $destination_id . "').style.visibility = 'hidden';\n";
$response .= "\ttbb=document.createElement('INPUT');\n";
$response .= "\ttbb.setAttribute('class', 'btn');\n";
$response .= "\ttbb.setAttribute('style', 'margin-left: 4px;');\n";
$response .= "\ttbb.type='button';\n";
$response .= "\ttbb.value=\$('<div />').html('◁').text();\n";
$response .= "\ttbb.objs=[obj,tb,tbb];\n";
$response .= "\ttbb.onclick=function(){ Replace" . $destination_id . "(this.objs); }\n";
$response .= "\tobj.parentNode.insertBefore(tb,obj);\n";
$response .= "\tobj.parentNode.insertBefore(tbb,obj);\n";
$response .= "\tobj.parentNode.removeChild(obj);\n";
$response .= "\tReplace" . $destination_id . "(this.objs);\n";
$response .= "}\n";
$response .= "\n";
$response .= "function Replace" . $destination_id . "(obj){\n";
$response .= "\tobj[2].parentNode.insertBefore(obj[0],obj[2]);\n";
$response .= "\tobj[0].parentNode.removeChild(obj[1]);\n";
$response .= "\tobj[0].parentNode.removeChild(obj[2]);\n";
$response .= "\tdocument.getElementById('btn_select_to_input_" . $destination_id . "').style.visibility = 'visible';\n";
if ($onchange != '') {
$response .= "\t" . $onchange . ";\n";
}
$response .= "}\n";
$response .= "</script>\n";
$response .= "\n";
}
//set default to false
$select_found = false;
$response .= "\t<select name='" . $destination_name . "' id='" . $destination_id . "' class='formfld' style='" . $select_style . "' onchange=\"" . $onchange . "\">\n";
$response .= "\t\t\t<option value=''></option>\n";
foreach ($this->destinations as $row) {
$name = $row['name'];
$label = $row['label'];
$destination = $row['field']['destination'];
//add multi-lingual support
if (file_exists($_SERVER["PROJECT_ROOT"] . "/app/" . $name . "/app_languages.php")) {
$language2 = new text();
$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/' . $name);
}
if (count($row['result']['data']) > 0 and strlen($row['select_value'][$destination_type]) > 0) {
$response .= "\t\t<optgroup label='" . $text2['title-' . $label] . "'>\n";
$label2 = $label;
foreach ($row['result']['data'] as $data) {
$select_value = $row['select_value'][$destination_type];
$select_label = $row['select_label'];
foreach ($row['field'] as $key => $value) {
if ($key == 'destination' and is_array($value)) {
if ($value['type'] == 'csv') {
$array = explode($value['delimiter'], $data[$key]);
$select_value = str_replace("\${destination}", $array[0], $select_value);
$select_label = str_replace("\${destination}", $array[0], $select_label);
}
} else {
if (strpos($value, ',') !== false) {
$keys = explode(",", $value);
foreach ($keys as $k) {
if (strlen($data[$k]) > 0) {
$select_value = str_replace("\${" . $key . "}", $data[$k], $select_value);
if (strlen($data['label']) == 0) {
$select_label = str_replace("\${" . $key . "}", $data[$k], $select_label);
} else {
$label = $data['label'];
$select_label = str_replace("\${" . $key . "}", $text2['option-' . $label], $select_label);
}
}
}
} else {
$select_value = str_replace("\${" . $key . "}", $data[$key], $select_value);
if (strlen($data['label']) == 0) {
$select_label = str_replace("\${" . $key . "}", $data[$key], $select_label);
} else {
$label = $data['label'];
//.........这里部分代码省略.........