本文整理汇总了PHP中get_opendb_lang_var函数的典型用法代码示例。如果您正苦于以下问题:PHP get_opendb_lang_var函数的具体用法?PHP get_opendb_lang_var怎么用?PHP get_opendb_lang_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_opendb_lang_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_edit_announcement_input_form
function get_edit_announcement_input_form($announcement_r, $HTTP_VARS = NULL)
{
global $PHP_SELF;
$buffer .= "<form action=\"{$PHP_SELF}\" method=\"POST\">";
$buffer .= "\n<input type=\"hidden\" name=\"type\" value=\"announcements\">";
if (is_array($announcement_r)) {
$buffer .= "\n<input type=\"hidden\" name=\"op\" value=\"update\">" . "\n<input type=\"hidden\" name=\"announcement_id\" value=\"" . $announcement_r['announcement_id'] . "\">";
} else {
$buffer .= "\n<input type=\"hidden\" name=\"op\" value=\"insert\">";
}
$buffer .= "<table>";
$buffer .= get_input_field("title", NULL, 'Title', "text(50,500)", "Y", ifempty($announcement_r['title'], $HTTP_VARS['title']), TRUE);
$buffer .= get_input_field("content", NULL, 'Announcement', "htmlarea(60,15)", "Y", ifempty($announcement_r['content'], $HTTP_VARS['content']), TRUE);
$buffer .= get_input_field("display_days", NULL, 'Display Days', "number(10,10)", "Y", ifempty($announcement_r['display_days'], $HTTP_VARS['display_days']), TRUE);
if (is_array($announcement_r)) {
$buffer .= get_input_field("closed_ind", NULL, 'Closed', "checkbox(Y,N)", "N", ifempty($announcement_r['closed_ind'], $HTTP_VARS['closed_ind']), TRUE);
}
$buffer .= "</table>";
$help_r[] = array('img' => 'compulsory.gif', 'text' => get_opendb_lang_var('compulsory_field'), id => 'compulsory');
$help_r[] = array('text' => 'A zero in Display Days indicates the announcment will never expire.');
$help_r[] = array('text' => 'No validation is performed on HTML entered in the Announcement text field.');
$buffer .= format_help_block($help_r);
if (get_opendb_config_var('widgets', 'enable_javascript_validation') !== FALSE) {
$onclick_event = "if(!checkForm(this.form)){return false;}else{this.form.submit();}";
} else {
$onclick_event = "this.form.submit();";
}
$buffer .= "<input type=\"button\" class=\"button\" onclick=\"{$onclick_event}\" value=\"Save\">";
$buffer .= "\n</form>";
return $buffer;
}
示例2: get_announcements_block
function get_announcements_block()
{
$buffer = '';
if (is_user_granted_permission(PERM_ADMIN_ANNOUNCEMENTS)) {
// include a login warning if user password and email are still the defaults
if (get_opendb_session_var('user_id') == 'admin') {
$announcements_rs = get_admin_announcements_rs();
while (list(, $announcement_r) = each($announcements_rs)) {
$buffer .= "<li><h4>" . $announcement_r['heading'] . "</h4>\n\t\t\t\t\t<p class=\"content\">" . $announcement_r['message'] . "<a class=\"adminLink\" href=\"" . $announcement_r['link'] . "\">" . $announcement_r['link_text'] . "</a></p>";
}
}
}
if (get_opendb_config_var('welcome.announcements', 'enable') !== FALSE && is_user_granted_permission(PERM_VIEW_ANNOUNCEMENTS)) {
$results = fetch_announcement_rs('submit_on', 'DESC', 0, get_opendb_config_var('welcome.announcements', 'display_count'), 'Y', 'Y');
if ($results) {
while ($announcement_r = db_fetch_assoc($results)) {
$buffer .= "<li><h4>" . $announcement_r['title'] . "</h4>";
$buffer .= "<small class=\"submitDate\">" . get_localised_timestamp(get_opendb_config_var('welcome.announcements', 'datetime_mask'), $announcement_r['submit_on']) . "</small>";
$buffer .= "<p class=\"content\">" . nl2br($announcement_r['content']) . "</p></li>";
}
db_free_result($results);
}
}
if (strlen($buffer) > 0) {
return "\n<div id=\"announcements\">" . "<h3>" . get_opendb_lang_var('announcements') . "</h3>" . "\n<ul>" . $buffer . "\n</ul></div>";
} else {
return NULL;
}
}
示例3: get_lang_var_days_r
function get_lang_var_days_r($abbrev = FALSE)
{
$suffix = '';
if ($abbrev) {
$suffix = '_abbrev';
}
return array(get_opendb_lang_var('sunday' . $suffix), get_opendb_lang_var('monday' . $suffix), get_opendb_lang_var('tuesday' . $suffix), get_opendb_lang_var('wednesday' . $suffix), get_opendb_lang_var('thursday' . $suffix), get_opendb_lang_var('friday' . $suffix), get_opendb_lang_var('saturday' . $suffix));
}
示例4: getHeading
function getHeading()
{
if (strlen($this->_titlelangvar) > 0) {
return '<h3>' . get_opendb_lang_var($this->_titlelangvar) . '</h3>';
} else {
return NULL;
}
}
示例5: theme_footer
function theme_footer($pageid, $user_id)
{
echo "</div>";
if ($pageid != 'install') {
echo "<div id=\"footer\"><a href=\"http://github.com/pellcorp/opendb\">" . get_opendb_lang_var('powered_by_site', 'site', get_opendb_title_and_version()) . "</a></div>";
}
echo "</body></html>";
}
示例6: get_opendb_rss_feeds
function get_opendb_rss_feeds()
{
$feeds_r = array();
if (is_user_granted_permission(PERM_VIEW_ANNOUNCEMENTS)) {
$feeds_r[] = array(feed => 'announcements', title => get_opendb_lang_var('announcements'));
}
if (is_user_granted_permission(PERM_VIEW_LISTINGS)) {
$feeds_r[] = array(feed => 'new_items', title => get_opendb_lang_var('new_items_added'));
}
return $feeds_r;
}
示例7: get_ilcc_derived_prompt
function get_ilcc_derived_prompt($item_listing_column_conf_r)
{
switch ($item_listing_column_conf_r['column_type']) {
case 's_field_type':
switch ($item_listing_column_conf_r['s_field_type']) {
case 'ITEMTYPE':
return get_opendb_lang_var('type');
case 'ITEM_ID':
$v_attribute_type_r = fetch_attribute_type_r('S_ITEM_ID');
return $v_attribute_type_r['prompt'];
break;
case 'TITLE':
return get_opendb_lang_var('title');
break;
case 'OWNER':
return get_opendb_lang_var('owner');
break;
case 'CATEGORY':
return get_opendb_lang_var('category');
break;
case 'STATUSTYPE':
return get_opendb_lang_var('status');
break;
case 'STATUSCMNT':
return get_opendb_lang_var('status_comment');
break;
case 'RATING':
$v_attribute_type_r = fetch_attribute_type_r('S_RATING');
return $v_attribute_type_r['prompt'];
break;
}
break;
case 'action_links':
return get_opendb_lang_var('action');
break;
case 'borrow_status':
return get_opendb_lang_var('borrow_status');
break;
case 's_attribute_type':
if (strlen($item_listing_column_conf_r['s_attribute_type']) > 0) {
$v_attribute_type_r = fetch_attribute_type_r($item_listing_column_conf_r['s_attribute_type']);
return $v_attribute_type_r['prompt'];
} else {
return NULL;
}
break;
}
//else
return NULL;
}
示例8: validate_review_input
function validate_review_input($HTTP_VARS, &$errors)
{
$errors = NULL;
if (get_opendb_config_var('item_review', 'comment_compulsory') == TRUE && strlen($HTTP_VARS['comment']) == 0) {
$errors[] = array(error => get_opendb_lang_var('prompt_must_be_specified', 'prompt', get_opendb_lang_var('review')));
}
if (get_opendb_config_var('item_review', 'rating_compulsory') == TRUE && strlen($HTTP_VARS['rating']) == 0) {
$errors[] = array(error => get_opendb_lang_var('prompt_must_be_specified', 'prompt', get_opendb_lang_var('rating')));
}
if (is_array($errors)) {
return FALSE;
} else {
return TRUE;
}
}
示例9: handleImport
function handleImport()
{
$parser = xml_parser_create('ISO-8859-1');
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, FALSE);
xml_set_object($parser, $this);
xml_set_element_handler($parser, "__startElement", "__endElement");
xml_set_character_data_handler($parser, "__characterData");
while (($data = $this->fileHandler->readLine()) !== FALSE) {
if (!xml_parse($parser, $data, $this->fileHandler->isEof())) {
$this->_error = get_opendb_lang_var('xml_error', array('xml_error_string' => xml_error_string(xml_get_error_code($parser)), 'xml_error_line' => xml_get_current_line_number($parser)));
return FALSE;
}
}
xml_parser_free($parser);
return TRUE;
}
示例10: getItemsPerPageControl
function getItemsPerPageControl($PHP_SELF, $HTTP_VARS)
{
$buffer = '';
$items_per_page_options_r = get_opendb_config_var('listings', 'items_per_page_options');
if (is_not_empty_array($items_per_page_options_r)) {
$items_per_page_rs = array();
while (list(, $items_per_page) = each($items_per_page_options_r)) {
if ($items_per_page == '0') {
$display = get_opendb_lang_var('all');
} else {
$display = $items_per_page;
}
$items_per_page_rs[] = array('value' => $items_per_page, 'display' => $display);
}
$buffer .= "<form class=\"itemsPerPageControl\" id=\"form-items_per_page\" action=\"" . $PHP_SELF . "\" method=\"GET\">" . get_url_fields($HTTP_VARS) . "<label for=\"select-items_per_page\">" . get_opendb_lang_var('items_per_page') . '</label>' . "<select id=\"select-items_per_page\" name=\"items_per_page\" class=\"footer\" onChange=\"this.form.submit()\">" . custom_select('items_per_page', $items_per_page_rs, '%display%', 'NA', ifempty($HTTP_VARS['items_per_page'], get_opendb_config_var('listings', 'items_per_page')), 'value') . "\n</select></form>";
}
return $buffer;
}
示例11: Listing
function Listing($PHP_SELF, $HTTP_VARS)
{
$this->_php_self = $PHP_SELF;
$this->_http_vars = $HTTP_VARS;
$this->_mode = $mode;
if (isset($HTTP_VARS['items_per_page'])) {
$this->_items_per_page = $HTTP_VARS['items_per_page'];
} else {
$this->_items_per_page = get_opendb_config_var('listings', 'items_per_page');
}
// initialise these, as they will most likely NOT be initialised via setTotalItems
if (!is_numeric($this->_items_per_page)) {
$this->_page_no = 1;
$this->_start_index = NULL;
}
$this->_current_orderby = $this->_http_vars['order_by'];
$this->_current_sortorder = $this->_http_vars['sortorder'];
// initialise to default.
$this->_no_rows_message = get_opendb_lang_var('no_matches_found');
$this->_titleMaskCfg = new TitleMask('item_listing');
}
示例12: getToggleControl
echo "<ul class=\"listingControls\">";
if (get_opendb_config_var('listings', 'allow_override_show_item_image') !== FALSE) {
echo "<li>" . getToggleControl($PHP_SELF, $HTTP_VARS, get_opendb_lang_var('show_item_image'), 'show_item_image', ifempty($HTTP_VARS['show_item_image'], get_opendb_config_var('listings', 'show_item_image') == TRUE ? 'Y' : 'N')) . "</li>";
}
echo "<li>" . getItemsPerPageControl($PHP_SELF, $HTTP_VARS) . "</li>";
echo "</ul>";
echo "<p class=\"listingDate\">" . get_opendb_lang_var('listing_generated', 'datetime', get_localised_timestamp(get_opendb_config_var('listings', 'print_listing_datetime_mask'))) . "</p>";
echo format_footer_links($footer_links_r);
echo _theme_footer();
}
//end if($show_listings)
} else {
//no guests allowed!
opendb_not_authorised_page(PERM_USER_BORROWER, $HTTP_VARS);
}
} else {
//borrow functionality disabled.
echo _theme_header(get_opendb_lang_var('borrow_not_supported'));
echo "<p class=\"error\">" . get_opendb_lang_var('borrow_not_supported') . "</p>";
echo _theme_footer();
}
} else {
// invalid login, so login instead.
redirect_login($PHP_SELF, $HTTP_VARS);
}
} else {
//if(is_site_enabled())
opendb_site_disabled();
}
// Cleanup after begin.inc.php
require_once "./include/end.inc.php";
示例13: endItem
function endItem()
{
if ($this->_is_item_finished !== TRUE) {
if ($this->_item_obj != NULL) {
// instance was not closed, close it now!
if ($this->_is_item_instance) {
$this->_is_item_instance = FALSE;
}
// if not item instance, create one
if (is_empty_array($this->_instance_item_obj_rs)) {
$this->startItemInstance();
$this->endItemInstance();
}
// The item is finished, no more additions are allowed, until the
// startItem method is called again.
$this->_is_item_finished = TRUE;
$item_vars = $this->__getItemHTTPVars($this->_item_obj);
$item_vars['trial_run'] = $this->_cfg_is_trial_run ? 'true' : 'false';
$item_vars['confirmed'] = $this->_cfg_ignore_duplicate_title ? 'true' : 'false';
$item_r = array(s_item_type => $this->_item_obj->getItemType(), owner_id => $this->getOwner(), title => $this->_item_obj->getTitle());
$instance_valid = FALSE;
$errors = array();
$return_val = handle_item_insert($item_r, $item_vars, $errors);
if ($return_val === TRUE) {
// store item id for later use
if ($this->_cfg_is_trial_run !== TRUE && is_numeric($item_r['item_id'])) {
$this->_item_id_list_r[] = $item_r['item_id'];
}
for ($i = 0; $i < count($this->_instance_item_obj_rs); $i++) {
$instanceObj = $this->_instance_item_obj_rs[$i];
// if status type is to be overriden, do it here!
if ($this->_cfg_override_status_type) {
$status_type_r = $this->_cfg_default_status_type_r;
} else {
$status_type_r = fetch_status_type_r($instanceObj->getStatusType());
// if illegal type, then override by default.
if ($status_type_r['closed_ind'] == 'Y') {
$status_type_r = $this->_cfg_default_status_type_r;
}
}
$item_r['owner_id'] = $instanceObj->getOwnerID();
$item_r['s_status_type'] = $status_type_r['s_status_type'];
$instance_vars = $this->__getItemHTTPVars($instanceObj);
// we are missing instance attributes if already set in item
$instance_vars = array_merge($instance_vars, $item_vars);
$return_val = handle_item_instance_insert($item_r, $status_type_r, $item_vars, $errors);
if ($return_val !== FALSE) {
$item_r['instance_no'] = $this->_cfg_is_trial_run ? $i + 1 : $item_r['instance_no'];
//$instanceObj->setInstanceNo($this->_cfg_is_trial_run?$i+1:$item_r['instance_no']);
$this->__listing_item_import_result_row($item_r, $status_type_r, $instance_vars, NULL);
// indicates at least one instance inserted.
$instance_valid = TRUE;
} else {
$item_r['instance_no'] = $this->_cfg_is_trial_run ? $i + 1 : $item_r['instance_no'];
//$instanceObj->setInstanceNo($this->_cfg_is_trial_run?$i+1:$item_r['instance_no']);
$this->__listing_item_import_result_row($item_r, $status_type_r, $instance_vars, $errors);
}
}
} else {
$this->__listing_item_import_result_row($item_r, NULL, $item_vars, $errors);
}
$this->_item_obj = NULL;
// end of parent item.
return TRUE;
} else {
$this->_item_obj = NULL;
$this->addError('endItem', get_opendb_lang_var('undefined_error'));
return FALSE;
}
} else {
// if($this->_is_item_finished !== TRUE)
return FALSE;
}
}
示例14: _theme_header
// make sure it ends in html
if (is_exists_language($language) && ends_with($page, ".html") && @file_exists("./help/{$language}/{$page}")) {
return "./help/{$language}/{$page}";
}
// else
return NULL;
}
if (is_site_enabled()) {
if (is_opendb_valid_session() || is_site_public_access()) {
echo _theme_header(get_opendb_lang_var('help'), FALSE);
if (($page_location = validate_opendb_lang_help_page_url($HTTP_VARS['page'])) != NULL) {
$page_title = get_opendb_lang_var('site_help', 'site', get_opendb_config_var('site', 'title'));
echo "<h2>" . $page_title . "</h2>";
// TODO: Add support for topic and subtopic
include $page_location;
} else {
echo _theme_header(get_opendb_lang_var('no_help_available'), FALSE);
echo "<p class=\"error\">" . get_opendb_lang_var('no_help_available') . "</p>";
}
echo _theme_footer();
} else {
//not a valid session.
// invalid login, so login instead.
redirect_login($PHP_SELF, $HTTP_VARS);
}
} else {
//if(is_site_enabled())
opendb_site_disabled();
}
// Cleanup after begin.inc.php
require_once "./include/end.inc.php";
示例15: format_error_block
} else {
echo "\n<h3>New Attribute type</h3>";
$save_op = 'insert';
$save_button = 'Insert';
}
if (is_not_empty_array($errors)) {
echo format_error_block($errors);
}
echo "\n<form name=\"s_attribute_type\" action=\"{$PHP_SELF}\" method=\"POST\">";
echo "\n<input type=\"hidden\" name=\"type\" value=\"" . $HTTP_VARS['type'] . "\">";
echo "\n<input type=\"hidden\" name=\"op\" value=\"{$save_op}\">";
echo "\n<input type=\"hidden\" name=\"active_tab\" value=\"" . $HTTP_VARS['active_tab'] . "\">";
echo "\n<table>";
display_edit_form($attribute_type_r, $HTTP_VARS);
echo "\n</table>";
echo format_help_block(array('img' => 'compulsory.gif', 'text' => get_opendb_lang_var('compulsory_field'), id => 'compulsory'));
if (get_opendb_config_var('widgets', 'enable_javascript_validation') !== FALSE) {
echo "\n<input type=\"button\" class=\"button\" value=\"{$save_button}\" onclick=\"if(!checkForm(this.form)){return false;}else{this.form.submit();}\">";
} else {
echo "\n<input type=\"button\" class=\"button\" value=\"{$save_button}\" onclick=\"this.form.submit();\">";
}
echo "\n</form>";
} else {
if ($HTTP_VARS['op'] == 'edit-lookups') {
// ################################################################
// Do for both 'update' and 'edit'
// ################################################################
echo "<p>[<a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&active_tab=" . $HTTP_VARS['active_tab'] . "\">Back to Main</a>]</p>";
echo "<script language=\"JavaScript1.2\">\n\t\tfunction toggleChecked(element, name)\n\t\t{\n\t\t\tvar form = element.form;\n\n\t\t\t// then we have to uncheck everything else.\n\t\t\tfor (var i=0; i < form.length; i++)\n\t\t\t{\n\t\t if (form.elements[i].type.toLowerCase() == 'checkbox' && form.elements[i].name.substring(0, name.length+1) == name+'[')\n\t\t\t\t{\n\t\t\t\t\tif(element.checked && form.elements[i].name != element.name)\n\t\t form.elements[i].checked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}</script>";
echo "\n<h3>Edit " . $HTTP_VARS['s_attribute_type'] . " Attribute Type Lookups</h3>";
if (is_not_empty_array($errors)) {