本文整理汇总了PHP中tohtml函数的典型用法代码示例。如果您正苦于以下问题:PHP tohtml函数的具体用法?PHP tohtml怎么用?PHP tohtml使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tohtml函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_generatePage
/**
* Generate page
*
* @param iMSCP_pTemplate $tpl
* @return void
*/
function admin_generatePage($tpl)
{
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
if (!isset($cfg['CHECK_FOR_UPDATES']) || !$cfg['CHECK_FOR_UPDATES']) {
set_page_message(tr('i-MSCP version update checking is disabled'), 'static_warning');
} else {
/** @var iMSCP_Update_Version $updateVersion */
$updateVersion = iMSCP_Update_Version::getInstance();
if ($updateVersion->isAvailableUpdate()) {
if ($updateInfo = $updateVersion->getUpdateInfo()) {
$date = new DateTime($updateInfo['published_at']);
$tpl->assign(array('TR_UPDATE_INFO' => tr('Update info'), 'TR_RELEASE_VERSION' => tr('Release version'), 'RELEASE_VERSION' => tohtml($updateInfo['tag_name']), 'TR_RELEASE_DATE' => tr('Release date'), 'RELEASE_DATE' => tohtml($date->format($cfg['DATE_FORMAT'])), 'TR_RELEASE_DESCRIPTION' => tr('Release description'), 'RELEASE_DESCRIPTION' => tohtml($updateInfo['body']), 'TR_DOWNLOAD_LINKS' => tr('Download links'), 'TR_DOWNLOAD_ZIP' => tr('Download ZIP'), 'TR_DOWNLOAD_TAR' => tr('Download TAR'), 'TARBALL_URL' => tohtml($updateInfo['tarball_url']), 'ZIPBALL_URL' => tohtml($updateInfo['zipball_url'])));
return;
} else {
set_page_message($updateVersion->getError(), 'error');
}
} elseif ($updateVersion->getError()) {
set_page_message($updateVersion, 'error');
} else {
set_page_message(tr('No update available'), 'static_info');
}
}
$tpl->assign('UPDATE_INFO', '');
}
示例2: client_generatePage
/**
* Generate page
*
* @param $tpl iMSCP_pTemplate
* @return void
*/
function client_generatePage($tpl)
{
if (isset($_GET['id'])) {
$domainAliasId = clean_input($_GET['id']);
if (!($domainAliasData = _client_getAliasData($domainAliasId))) {
showBadRequestErrorPage();
}
if (empty($_POST)) {
if ($domainAliasData['forward_url'] != 'no') {
$urlForwarding = true;
$uri = iMSCP_Uri_Redirect::fromString($domainAliasData['forward_url']);
$forwardUrlScheme = $uri->getScheme();
$forwardUrl = substr($uri->getUri(), strlen($forwardUrlScheme) + 3);
} else {
$urlForwarding = false;
$forwardUrlScheme = 'http://';
$forwardUrl = '';
}
} else {
$urlForwarding = isset($_POST['url_forwarding']) && $_POST['url_forwarding'] == 'yes' ? true : false;
$forwardUrlScheme = isset($_POST['forward_url_scheme']) ? $_POST['forward_url_scheme'] : 'http://';
$forwardUrl = isset($_POST['forward_url']) ? $_POST['forward_url'] : '';
}
/** @var iMSCP_Config_Handler_File $cfg */
$cfg = iMSCP_Registry::get('config');
$checked = $cfg->HTML_CHECKED;
$selected = $cfg->HTML_SELECTED;
$tpl->assign(array('DOMAIN_ALIAS_ID' => $domainAliasId, 'DOMAIN_ALIAS_NAME' => tohtml($domainAliasData['alias_name_utf8']), 'FORWARD_URL_YES' => $urlForwarding ? $checked : '', 'FORWARD_URL_NO' => $urlForwarding ? '' : $checked, 'HTTP_YES' => $forwardUrlScheme == 'http://' ? $selected : '', 'HTTPS_YES' => $forwardUrlScheme == 'https://' ? $selected : '', 'FTP_YES' => $forwardUrlScheme == 'ftp://' ? $selected : '', 'FORWARD_URL' => tohtml(decode_idna($forwardUrl))));
} else {
showBadRequestErrorPage();
}
}
示例3: gen_reseller_table
/**
* @todo check if it's useful to have the table admin two times in the same query
* @param EasySCP_TemplateEngine $tpl
*/
function gen_reseller_table($tpl)
{
$cfg = EasySCP_Registry::get('Config');
$sql = EasySCP_Registry::get('Db');
$query = "\n\t\tSELECT\n\t\t\tt1.`admin_id`, t1.`admin_name`, t2.`admin_name` AS created_by\n\t\tFROM\n\t\t\t`admin` AS t1,\n\t\t\t`admin` AS t2\n\t\tWHERE\n\t\t\tt1.`admin_type` = 'reseller'\n\t\tAND\n\t\t\tt1.`created_by` = t2.`admin_id`\n\t\tORDER BY\n\t\t\t`created_by`,\n\t\t\t`admin_id`\n\t";
$rs = exec_query($sql, $query);
$i = 0;
if ($rs->recordCount() == 0) {
set_page_message(tr('Reseller list is empty!'), 'info');
} else {
while (!$rs->EOF) {
$admin_id = $rs->fields['admin_id'];
$admin_id_var_name = "admin_id_" . $admin_id;
$tpl->append(array('NUMBER' => $i + 1, 'RESELLER_NAME' => tohtml($rs->fields['admin_name']), 'OWNER' => tohtml($rs->fields['created_by']), 'CKB_NAME' => $admin_id_var_name));
$rs->moveNext();
$i++;
}
$tpl->assign('PAGE_MESSAGE', '');
}
$query = "\n\t\tSELECT\n\t\t\t`admin_id`, `admin_name`\n\t\tFROM\n\t\t\t`admin`\n\t\tWHERE\n\t\t\t`admin_type` = 'admin'\n\t\tORDER BY\n\t\t\t`admin_name`\n\t";
$rs = exec_query($sql, $query);
while (!$rs->EOF) {
if (isset($_POST['uaction']) && $_POST['uaction'] === 'reseller_owner' && (isset($_POST['dest_admin']) && $_POST['dest_admin'] == $rs->fields['admin_id'])) {
$selected = $cfg->HTML_SELECTED;
} else {
$selected = '';
}
$tpl->append(array('OPTION' => tohtml($rs->fields['admin_name']), 'VALUE' => $rs->fields['admin_id'], 'SELECTED' => $selected));
$rs->moveNext();
}
$tpl->assign('PAGE_MESSAGE', '');
}
示例4: gen_reseller_personal_data
/**
* @param iMSCP_pTemplate $tpl
* @param $user_id
*/
function gen_reseller_personal_data($tpl, $user_id)
{
$cfg = iMSCP_Registry::get('config');
$query = "\n\t\tSELECT\n\t\t\t`fname`,\n\t\t\t`lname`,\n\t\t\t`gender`,\n\t\t\t`firm`,\n\t\t\t`zip`,\n\t\t\t`city`,\n\t\t\t`state`,\n\t\t\t`country`,\n\t\t\t`street1`,\n\t\t\t`street2`,\n\t\t\t`email`,\n\t\t\t`phone`,\n\t\t\t`fax`\n\t\tFROM\n\t\t\t`admin`\n\t\tWHERE\n\t\t\t`admin_id` = ?\n\t";
$rs = exec_query($query, $user_id);
$tpl->assign(array('FIRST_NAME' => $rs->fields['fname'] == null ? '' : tohtml($rs->fields['fname']), 'LAST_NAME' => $rs->fields['lname'] == null ? '' : tohtml($rs->fields['lname']), 'FIRM' => $rs->fields['firm'] == null ? '' : tohtml($rs->fields['firm']), 'ZIP' => $rs->fields['zip'] == null ? '' : tohtml($rs->fields['zip']), 'CITY' => $rs->fields['city'] == null ? '' : tohtml($rs->fields['city']), 'STATE' => $rs->fields['state'] == null ? '' : tohtml($rs->fields['state']), 'COUNTRY' => $rs->fields['country'] == null ? '' : tohtml($rs->fields['country']), 'STREET_1' => $rs->fields['street1'] == null ? '' : tohtml($rs->fields['street1']), 'STREET_2' => $rs->fields['street2'] == null ? '' : tohtml($rs->fields['street2']), 'EMAIL' => $rs->fields['email'] == null ? '' : tohtml($rs->fields['email']), 'PHONE' => $rs->fields['phone'] == null ? '' : tohtml($rs->fields['phone']), 'FAX' => $rs->fields['fax'] == null ? '' : tohtml($rs->fields['fax']), 'VL_MALE' => $rs->fields['gender'] == 'M' ? $cfg->HTML_SELECTED : '', 'VL_FEMALE' => $rs->fields['gender'] == 'F' ? $cfg->HTML_SELECTED : '', 'VL_UNKNOWN' => $rs->fields['gender'] == 'U' || empty($rs->fields['gender']) ? $cfg->HTML_SELECTED : ''));
}
示例5: generatePage
/**
* Generate page
*
* @param $tpl iMSCP_pTemplate
* @return void
*/
function generatePage($tpl)
{
$tpl->assign(array('DOMAIN_ALIAS_NAME' => isset($_POST['domain_alias_name']) ? tohtml($_POST['domain_alias_name']) : '', 'SHARED_MOUNT_POINT_YES' => isset($_POST['shared_mount_point']) && $_POST['shared_mount_point'] == 'yes' ? ' checked' : '', 'SHARED_MOUNT_POINT_NO' => isset($_POST['shared_mount_point']) && $_POST['shared_mount_point'] == 'yes' ? '' : ' checked', 'FORWARD_URL_YES' => isset($_POST['url_forwarding']) && $_POST['url_forwarding'] == 'yes' ? ' checked' : '', 'FORWARD_URL_NO' => isset($_POST['url_forwarding']) && $_POST['url_forwarding'] == 'yes' ? '' : ' checked', 'HTTP_YES' => isset($_POST['forward_url_scheme']) && $_POST['forward_url_scheme'] == 'http://' ? ' selected' : '', 'HTTPS_YES' => isset($_POST['forward_url_scheme']) && $_POST['forward_url_scheme'] == 'https://' ? ' selected' : '', 'FTP_YES' => isset($_POST['forward_url_scheme']) && $_POST['forward_url_scheme'] == 'ftp://' ? ' selected' : '', 'FORWARD_URL' => isset($_POST['forward_url']) ? tohtml(decode_idna($_POST['forward_url'])) : ''));
foreach (getDomainsList() as $domain) {
$tpl->assign(array('DOMAIN_NAME' => tohtml($domain['name']), 'DOMAIN_NAME_UNICODE' => tohtml(decode_idna($domain['name'])), 'SHARED_MOUNT_POINT_DOMAIN_SELECTED' => isset($_POST['shared_mount_point_domain']) && $_POST['shared_mount_point_domain'] == $domain['name'] ? ' selected' : ''));
$tpl->parse('SHARED_MOUNT_POINT_DOMAIN', '.shared_mount_point_domain');
}
}
示例6: reseller_generatePage
/**
* Generates page.
*
* @param iMSCP_pTemplate $tpl Template engine instance
*/
function reseller_generatePage($tpl)
{
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$query = "SELECT domain_created from admin where admin_id = ?";
$stmt = exec_query($query, (int) $_SESSION['user_id']);
$tpl->assign(array('TR_ACCOUNT_SUMMARY' => tr('Account summary'), 'TR_USERNAME' => tr('Username'), 'USERNAME' => tohtml($_SESSION['user_logged']), 'TR_ACCOUNT_TYPE' => tr('Account type'), 'ACCOUNT_TYPE' => $_SESSION['user_type'], 'TR_REGISTRATION_DATE' => tr('Registration date'), 'REGISTRATION_DATE' => $stmt->fields['domain_created'] != 0 ? date($cfg->DATE_FORMAT, $stmt->fields['domain_created']) : tr('Unknown')));
}
示例7: generatePage
/**
* Generates page
*
* @param iMSCP_pTemplate $tpl Template engine
* @return void
*/
function generatePage($tpl)
{
global $hpId, $dmnName, $adminName, $email, $customerId, $firstName, $lastName, $gender, $firm, $zip, $city, $state, $country, $street1, $street2, $phone, $fax, $domainIp;
$adminName = decode_idna($adminName);
$tpl->assign(array('VL_USERNAME' => tohtml($adminName, 'htmlAttr'), 'VL_MAIL' => tohtml($email, 'htmlAttr'), 'VL_USR_ID' => tohtml($customerId, 'htmlAttr'), 'VL_USR_NAME' => tohtml($firstName, 'htmlAttr'), 'VL_LAST_USRNAME' => tohtml($lastName, 'htmlAttr'), 'VL_USR_FIRM' => tohtml($firm, 'htmlAttr'), 'VL_USR_POSTCODE' => tohtml($zip, 'htmlAttr'), 'VL_USRCITY' => tohtml($city, 'htmlAttr'), 'VL_USRSTATE' => tohtml($state, 'htmlAttr'), 'VL_MALE' => $gender == 'M' ? ' selected' : '', 'VL_FEMALE' => $gender == 'F' ? ' selected' : '', 'VL_UNKNOWN' => $gender == 'U' ? ' selected' : '', 'VL_COUNTRY' => tohtml($country, 'htmlAttr'), 'VL_STREET1' => tohtml($street1, 'htmlAttr'), 'VL_STREET2' => tohtml($street2, 'htmlAttr'), 'VL_PHONE' => tohtml($phone, 'htmlAttr'), 'VL_FAX' => tohtml($fax, 'htmlAttr')));
reseller_generate_ip_list($tpl, $_SESSION['user_id'], $domainIp);
$_SESSION['local_data'] = "{$dmnName};{$hpId}";
}
示例8: gen_def_language
/**
* Creates a list of all current installed languages
*
* @param string $lang_selected Defines the selected language
*/
function gen_def_language($lang_selected)
{
$cfg = EasySCP_Registry::get('Config');
$tpl = EasySCP_TemplateEngine::getInstance();
$languages = getLanguages();
foreach ($languages as $lang => $language_name) {
$tpl->append(array('LANG_VALUE' => $lang, 'LANG_SELECTED' => $lang === $lang_selected ? $cfg->HTML_SELECTED : '', 'LANG_NAME' => tohtml($language_name)));
}
}
示例9: _generateUserStatistics
/**
* Genrate statistics entry for the given user
*
* @param iMSCP_pTemplate $tpl Template engine instance
* @param int $adminId User unique identifier
* @return void
*/
function _generateUserStatistics($tpl, $adminId)
{
list($adminName, $domainId, $web, $ftp, $smtp, $pop3, $trafficUsageBytes, $diskspaceUsageBytes) = shared_getCustomerStats($adminId);
list($usub_current, $usub_max, $uals_current, $uals_max, $umail_current, $umail_max, $uftp_current, $uftp_max, $usql_db_current, $usql_db_max, $usql_user_current, $usql_user_max, $trafficMaxMebimytes, $diskspaceMaxMebibytes) = shared_getCustomerProps($adminId);
$trafficLimitBytes = $trafficMaxMebimytes * 1048576;
$diskspaceLimitBytes = $diskspaceMaxMebibytes * 1048576;
$trafficUsagePercent = make_usage_vals($trafficUsageBytes, $trafficLimitBytes);
$diskspaceUsagePercent = make_usage_vals($diskspaceUsageBytes, $diskspaceLimitBytes);
$tpl->assign(array('USER_NAME' => tohtml(decode_idna($adminName)), 'USER_ID' => tohtml($adminId), 'TRAFF_PERCENT' => tohtml($trafficUsagePercent), 'TRAFF_MSG' => $trafficLimitBytes ? tohtml(tr('%s of %s', bytesHuman($trafficUsageBytes), bytesHuman($trafficLimitBytes))) : tohtml(tr('%s of unlimited', bytesHuman($trafficUsageBytes))), 'DISK_PERCENT' => tohtml($diskspaceUsagePercent), 'DISK_MSG' => $diskspaceLimitBytes ? tohtml(tr('%s of %s', bytesHuman($diskspaceUsageBytes), bytesHuman($diskspaceLimitBytes))) : tohtml(tr('%s of unlimited', bytesHuman($diskspaceUsageBytes))), 'WEB' => tohtml(bytesHuman($web)), 'FTP' => tohtml(bytesHuman($ftp)), 'SMTP' => tohtml(bytesHuman($smtp)), 'POP3' => tohtml(bytesHuman($pop3)), 'SUB_MSG' => $usub_max ? tohtml(tr('%d of %s', $usub_current, translate_limit_value($usub_max))) : tohtml(translate_limit_value($usub_max)), 'ALS_MSG' => $uals_max ? tohtml(tr('%d of %s', $uals_current, translate_limit_value($uals_max))) : tohtml(translate_limit_value($uals_max)), 'MAIL_MSG' => $umail_max ? tohtml(tr('%d of %s', $umail_current, translate_limit_value($umail_max))) : tohtml(translate_limit_value($umail_max)), 'FTP_MSG' => $uftp_max ? tohtml(tr('%d of %s', $uftp_current, translate_limit_value($uftp_max))) : tohtml(translate_limit_value($uftp_max)), 'SQL_DB_MSG' => $usql_db_max ? tohtml(tr('%d of %s', $usql_db_current, translate_limit_value($usql_db_max))) : tohtml(translate_limit_value($usql_db_max)), 'SQL_USER_MSG' => $usql_user_max ? tohtml(tr('%1$d of %2$d', $usql_user_current, translate_limit_value($usql_user_max))) : tohtml(translate_limit_value($usql_user_max))));
}
示例10: client_generatePage
/**
* Generate page
*
* @param iMSCP_pTemplate $tpl
* @param int $id Sql user id
* @return array
*/
function client_generatePage($tpl, $id)
{
$stmt = exec_query('SELECT sqlu_name, sqlu_host, sqlu_pass FROM sql_user WHERE sqlu_id = ?', $id);
if (!$stmt->rowCount()) {
showBadRequestErrorPage();
}
$row = $stmt->fetchRow(PDO::FETCH_ASSOC);
$tpl->assign(array('USER_NAME' => tohtml($row['sqlu_name']), 'ID' => tohtml($id)));
return array($row['sqlu_name'], $row['sqlu_host'], $row['sqlu_pass']);
}
示例11: _generateUserStatistics
/**
* Generates statistics for the given user
*
* @access private
* @param iMSCP_pTemplate $tpl Template engine instance
* @param int $adminId User unique identifier
* @return void
*/
function _generateUserStatistics($tpl, $adminId)
{
list($adminName, , $webTraffic, $ftpTraffic, $smtpTraffic, $popImapTraffic, $trafficUsageBytes, $diskspaceUsageBytes) = shared_getCustomerStats($adminId);
list($subCount, $subMax, $alsCount, $alsMax, $mailCount, $mailMax, $ftpUserCount, $FtpUserMax, $sqlDbCount, $sqlDbMax, $sqlUserCount, $sqlUserMax, $trafficLimit, $diskspaceLimit) = shared_getCustomerProps($adminId);
$trafficLimitBytes = $trafficLimit * 1048576;
$diskspaceLimitBytes = $diskspaceLimit * 1048576;
$trafficPercent = make_usage_vals($trafficUsageBytes, $trafficLimitBytes);
$diskPercent = make_usage_vals($diskspaceUsageBytes, $diskspaceLimitBytes);
$tpl->assign(array('USER_ID' => tohtml($adminId), 'USERNAME' => tohtml(decode_idna($adminName)), 'TRAFF_PERCENT' => tohtml($trafficPercent), 'TRAFF_MSG' => $trafficLimitBytes ? tohtml(tr('%1$s / %2$s', bytesHuman($trafficUsageBytes), bytesHuman($trafficLimitBytes))) : tohtml(tr('%s / unlimited', bytesHuman($trafficUsageBytes))), 'DISK_PERCENT' => tohtml($diskPercent), 'DISK_MSG' => $diskspaceLimitBytes ? tohtml(tr('%1$s / %2$s', bytesHuman($diskspaceUsageBytes), bytesHuman($diskspaceLimitBytes))) : tohtml(tr('%s / unlimited', bytesHuman($diskspaceUsageBytes))), 'WEB' => tohtml(bytesHuman($webTraffic)), 'FTP' => tohtml(bytesHuman($ftpTraffic)), 'SMTP' => tohtml(bytesHuman($smtpTraffic)), 'POP3' => tohtml(bytesHuman($popImapTraffic)), 'SUB_MSG' => $subMax ? $subMax > 0 ? tohtml(tr('%1$d / %2$d', $subCount, $subMax)) : tohtml(tr('disabled')) : tohtml(tr('%d / unlimited', $subCount)), 'ALS_MSG' => $alsMax ? $alsMax > 0 ? tohtml(tr('%1$d / %2$d', $alsCount, $alsMax)) : tohtml(tr('disabled')) : tohtml(tr('%d / unlimited', $alsCount)), 'MAIL_MSG' => $mailMax ? $mailMax > 0 ? tohtml(tr('%1$d / %2$d', $mailCount, $mailMax)) : tohtml(tr('disabled')) : tohtml(tr('%d / unlimited', $mailCount)), 'FTP_MSG' => $FtpUserMax ? $FtpUserMax > 0 ? tohtml(tr('%1$d / %2$d', $ftpUserCount, $FtpUserMax)) : tohtml(tr('disabled')) : tohtml(tr('%d / unlimited', $ftpUserCount)), 'SQL_DB_MSG' => $sqlDbMax ? $sqlDbMax > 0 ? tohtml(tr('%1$d / %2$d', $sqlDbCount, $sqlDbMax)) : tohtml(tr('disabled')) : tohtml(tr('%d / unlimited', $sqlDbCount)), 'SQL_USER_MSG' => $sqlUserMax ? $sqlUserMax > 0 ? tohtml(tr('%1$d / %2$d', $sqlUserCount, $sqlUserMax)) : tohtml(tr('disabled')) : tohtml(tr('%d / unlimited', $sqlUserCount))));
}
示例12: do_mysql_query
function do_mysql_query($sql)
{
$res = mysql_query($sql);
if ($res == FALSE) {
echo '</select></p></div><div style="padding: 1em; color:red; font-size:120%; background-color:#CEECF5;">' . '<p><b>Fatal Error in SQL Query:</b> ' . tohtml($sql) . '</p>' . '<p><b>Error Code & Message:</b> [' . mysql_errno() . '] ' . tohtml(mysql_error()) . "</p></div><hr /><pre>Backtrace:\n\n";
debug_print_backtrace();
echo '</pre><hr />';
die('</body></html>');
} else {
return $res;
}
}
示例13: _generateResellerStatistics
/**
* Generates statistics for the given reseller
*
* @param iMSCP_pTemplate $tpl Template engine instance
* @param int $resellerId Reseller unique identifier
* @param string $resellerName Reseller name
* @return void
*/
function _generateResellerStatistics($tpl, $resellerId, $resellerName)
{
$resellerProps = imscp_getResellerProperties($resellerId, true);
list($udmn_current, , , $usub_current, , , $uals_current, , , $umail_current, , , $uftp_current, , , $usql_db_current, , , $usql_user_current, , , $utraff_current, , , $udisk_current, ) = generate_reseller_users_props($resellerId);
$trafficLimitBytes = $resellerProps['max_traff_amnt'] * 1048576;
$trafficUsageBytes = $resellerProps['current_traff_amnt'] * 1048576;
$diskspaceLimitBytes = $resellerProps['max_disk_amnt'] * 1048576;
$diskspaceUsageBytes = $resellerProps['current_disk_amnt'] * 1048576;
$trafficUsagePercent = make_usage_vals($trafficUsageBytes, $trafficLimitBytes);
$diskspaceUsagePercent = make_usage_vals($diskspaceUsageBytes, $diskspaceLimitBytes);
$tpl->assign(array('RESELLER_NAME' => tohtml($resellerName), 'RESELLER_ID' => tohtml($resellerId), 'TRAFFIC_PERCENT' => tohtml($trafficUsagePercent), 'TRAFFIC_MSG' => $trafficLimitBytes ? tohtml(tr('%1$s / %2$s of %3$s', bytesHuman($utraff_current), bytesHuman($trafficUsageBytes), bytesHuman($trafficLimitBytes))) : tohtml(tr('%1$s / %2$s of unlimited', bytesHuman($utraff_current), bytesHuman($trafficUsageBytes))), 'DISK_PERCENT' => tohtml($diskspaceUsagePercent), 'DISK_MSG' => $diskspaceLimitBytes ? tohtml(tr('%1$s / %2$s of %3$s', bytesHuman($udisk_current), bytesHuman($diskspaceUsageBytes), bytesHuman($diskspaceLimitBytes))) : tohtml(tr('%1$s / %2$s of unlimited', bytesHuman($udisk_current), bytesHuman($diskspaceUsageBytes))), 'DMN_MSG' => $resellerProps['max_dmn_cnt'] ? tohtml(tr('%1$d / %2$d of %3$d', $udmn_current, $resellerProps['current_dmn_cnt'], $resellerProps['max_dmn_cnt'])) : tohtml(tr('%1$d / %2$d of unlimited', $udmn_current, $resellerProps['current_dmn_cnt'])), 'SUB_MSG' => $resellerProps['max_sub_cnt'] > 0 ? tohtml(tr('%1$d / %2$d of %3$d', $usub_current, $resellerProps['current_sub_cnt'], $resellerProps['max_sub_cnt'])) : ($resellerProps['max_sub_cnt'] == '-1' ? tohtml(tr('disabled')) : tohtml(tr('%1$d / %2$d of unlimited', $usub_current, $resellerProps['current_sub_cnt']))), 'ALS_MSG' => $resellerProps['max_als_cnt'] > 0 ? tohtml(tr('%1$d / %2$d of %3$d', $uals_current, $resellerProps['current_als_cnt'], $resellerProps['max_als_cnt'])) : ($resellerProps['max_als_cnt'] == '-1' ? tohtml(tr('disabled')) : tohtml(tr('%1$d / %2$d of unlimited', $uals_current, $resellerProps['current_als_cnt']))), 'MAIL_MSG' => $resellerProps['max_mail_cnt'] > 0 ? tohtml(tr('%1$d / %2$d of %3$d', $umail_current, $resellerProps['current_mail_cnt'], $resellerProps['max_mail_cnt'])) : ($resellerProps['max_mail_cnt'] == '-1' ? tohtml(tr('disabled')) : tohtml(tr('%1$d / %2$d of unlimited', $umail_current, $resellerProps['current_mail_cnt']))), 'FTP_MSG' => $resellerProps['max_ftp_cnt'] > 0 ? tohtml(tr('%1$d / %2$d of %3$d', $uftp_current, $resellerProps['current_ftp_cnt'], $resellerProps['max_ftp_cnt'])) : ($resellerProps['max_ftp_cnt'] == '-1' ? tohtml(tr('disabled')) : tohtml(tr('%1$d / %2$d of unlimited', $uftp_current, $resellerProps['current_ftp_cnt']))), 'SQL_DB_MSG' => $resellerProps['max_sql_db_cnt'] > 0 ? tohtml(tr('%1$d / %2$d of %3$d', $usql_db_current, $resellerProps['current_sql_db_cnt'], $resellerProps['max_sql_db_cnt'])) : ($resellerProps['max_sql_db_cnt'] == '-1' ? tohtml(tr('disabled')) : tohtml(tr('%1$d / %2$d of unlimited', $usql_db_current, $resellerProps['current_sql_db_cnt']))), 'SQL_USER_MSG' => $resellerProps['max_sql_user_cnt'] > 0 ? tohtml(tr('%1$d / %2$d of %3$d', $usql_user_current, $resellerProps['current_sql_user_cnt'], $resellerProps['max_sql_user_cnt'])) : ($resellerProps['max_sql_user_cnt'] == '-1' ? tohtml(tr('disabled')) : tohtml(tr('%1$d / %2$d of unlimited', $usql_user_current, $resellerProps['current_sql_user_cnt'])))));
}
示例14: output_text
function output_text($saveterm, $saverom, $savetrans, $savetags, $show_rom, $show_trans, $show_tags, $annplcmnt)
{
if ($show_tags) {
if ($savetrans == '' && $savetags != '') {
$savetrans = '* ' . $savetags;
} else {
$savetrans = trim($savetrans . ' ' . $savetags);
}
}
if ($show_rom && $saverom == '') {
$show_rom = 0;
}
if ($show_trans && $savetrans == '') {
$show_trans = 0;
}
if ($annplcmnt == 1) {
if ($show_rom || $show_trans) {
echo ' ';
if ($show_trans) {
echo '<span class="anntrans">' . tohtml($savetrans) . '</span> ';
}
if ($show_rom && !$show_trans) {
echo '<span class="annrom">' . tohtml($saverom) . '</span> ';
}
if ($show_rom && $show_trans) {
echo '<span class="annrom" dir="ltr">[' . tohtml($saverom) . ']</span> ';
}
echo ' <span class="annterm">';
}
echo tohtml($saveterm);
if ($show_rom || $show_trans) {
echo '</span> ';
}
} else {
if ($show_rom || $show_trans) {
echo ' <span class="annterm">';
}
echo tohtml($saveterm);
if ($show_rom || $show_trans) {
echo '</span> ';
if ($show_rom && !$show_trans) {
echo '<span class="annrom">' . tohtml($saverom) . '</span>';
}
if ($show_rom && $show_trans) {
echo '<span class="annrom" dir="ltr">[' . tohtml($saverom) . ']</span> ';
}
if ($show_trans) {
echo '<span class="anntrans">' . tohtml($savetrans) . '</span>';
}
echo ' ';
}
}
}
示例15: gen_htaccess_entries
/**
* @param EasySCP_TemplateEngine $tpl
* @param EasySCP_Database $sql
* @param int $dmn_id
*/
function gen_htaccess_entries($tpl, $sql, &$dmn_id)
{
$query = "\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t`htaccess`\n\t\tWHERE\n\t\t\t`dmn_id` = ?\n\t";
$rs = exec_query($sql, $query, $dmn_id);
if ($rs->recordCount() == 0) {
set_page_message(tr('You do not have protected areas'), 'info');
} else {
while (!$rs->EOF) {
$auth_name = $rs->fields['auth_name'];
$tpl->append(array('AREA_NAME' => tohtml($auth_name), 'JS_AREA_NAME' => addslashes($auth_name), 'AREA_PATH' => tohtml($rs->fields['path']), 'PID' => $rs->fields['id'], 'STATUS' => translate_dmn_status($rs->fields['status'])));
$rs->moveNext();
}
}
}