当前位置: 首页>>代码示例>>PHP>>正文


PHP TextHelper::to_js_string方法代码示例

本文整理汇总了PHP中TextHelper::to_js_string方法的典型用法代码示例。如果您正苦于以下问题:PHP TextHelper::to_js_string方法的具体用法?PHP TextHelper::to_js_string怎么用?PHP TextHelper::to_js_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextHelper的用法示例。


在下文中一共展示了TextHelper::to_js_string方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($error_message = '')
 {
     if (empty($error_message)) {
         $error_message = LangLoader::get_message('form.doesnt_match_tel_regex', 'status-messages-common');
     }
     $this->set_validation_error_message($error_message);
     parent::__construct(self::$regex, TextHelper::to_js_string(self::$js_regex), $error_message);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:FormFieldConstraintTel.class.php

示例2: __construct

 public function __construct($label, $link, $img = '')
 {
     $full_label = '';
     if (!empty($img)) {
         $full_label = '<img src="' . $img . '" alt="' . $label . '" title="' . $label . '" />';
     } else {
         $full_label = $label;
     }
     parent::__construct('button', $full_label, '', 'window.location=' . TextHelper::to_js_string(Url::to_rel($link)), !empty($img) ? 'image' : '');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:FormButtonLink.class.php

示例3: __construct

 public function __construct($label, $link, $css_class_image = '')
 {
     $full_label = '';
     if (!empty($css_class_image)) {
         $full_label = '<i class="' . $css_class_image . '" title="' . $label . '"></i>';
     } else {
         $full_label = $label;
     }
     parent::__construct('button', $full_label, '', 'window.location=' . TextHelper::to_js_string(Url::to_rel($link)), 'image');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:FormButtonLinkCssImg.class.php

示例4: __construct

 public function __construct($field_id = 0, $error_message = '')
 {
     if (!empty($field_id)) {
         $this->field_id = $field_id;
     }
     if (empty($error_message)) {
         $error_message = LangLoader::get_message('message.field_name_already_used', 'common', 'contact');
     }
     $this->set_validation_error_message($error_message);
     $this->error_message = TextHelper::to_js_string($error_message);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:ContactConstraintFieldExist.class.php

示例5: __construct

 public function __construct($bug_id = 0, $bug_status = '', $error_message = '')
 {
     if (!empty($bug_id)) {
         $this->bug_id = $bug_id;
     }
     if (!empty($bug_status)) {
         $this->bug_status = $bug_status;
     }
     if (empty($error_message)) {
         $error_message = LangLoader::get_message('error.e_status_not_changed', 'common', 'bugtracker');
     }
     $this->set_validation_error_message($error_message);
     $this->error_message = TextHelper::to_js_string($error_message);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:14,代码来源:BugtrackerConstraintStatusChanged.class.php

示例6: i18njsraw

 public function i18njsraw($key, $parameters)
 {
     return TextHelper::to_js_string($this->i18nraw($key, $parameters));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:I18NMessages.class.php

示例7: get_js_validation

 public function get_js_validation(FormField $field)
 {
     return 'UserExistValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . $this->error_message . ')';
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:FormFieldConstraintUserExist.class.php

示例8: get_js_validation

 public function get_js_validation()
 {
     return 'equalityFormFieldValidator(' . TextHelper::to_js_string($this->first_field->get_id()) . ', ' . TextHelper::to_js_string($this->second_field->get_id()) . ', ' . TextHelper::to_js_string($this->get_validation_error_message()) . ')';
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:FormConstraintFieldsEquality.class.php

示例9: get_js_validation

    public function get_js_validation(FormField $field)
    {
        return 'integerMaxFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', 
		' . (int) $this->upper_bound . ', ' . TextHelper::to_js_string($this->error_message) . ')';
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:5,代码来源:FormFieldConstraintIntegerMax.class.php

示例10: stripslashes

$unsecure_search = stripslashes(retrieve(REQUEST, 'q', ''));
$search_in = retrieve(POST, 'search_in', 'all');
$selected_modules = retrieve(POST, 'searched_modules', array());
$query_mode = retrieve(POST, 'query_mode', true);
if ($search_in !== 'all') {
    $selected_modules = array($search_in);
} else {
    if (count($selected_modules) == 1) {
        $module = $selected_modules['0'];
        $search_in = $module;
    }
}
//--------------------------------------------------------------------- Header
define('TITLE', $LANG['title_search']);
require_once '../kernel/header.php';
$tpl->assign_vars(array('L_TITLE_SEARCH' => TITLE, 'L_SEARCH' => $LANG['title_search'], 'TEXT_SEARCHED' => $unsecure_search, 'L_SEARCH_ALL' => $LANG['search_all'], 'L_SEARCH_KEYWORDS' => $LANG['search_keywords'], 'L_SEARCH_MIN_LENGTH' => $LANG['search_min_length'], 'L_SEARCH_IN_MODULES' => $LANG['search_in_modules'], 'L_SEARCH_IN_MODULES_EXPLAIN' => $LANG['search_in_modules_explain'], 'L_SEARCH_SPECIALIZED_FORM' => $LANG['search_specialized_form'], 'L_SEARCH_SPECIALIZED_FORM_EXPLAIN' => $LANG['search_specialized_form_explain'], 'L_WARNING_LENGTH_STRING_SEARCH' => TextHelper::to_js_string($LANG['warning_length_string_searched']), 'L_FORMS' => $LANG['forms'], 'L_ADVANCED_SEARCH' => $LANG['advanced_search'], 'L_SIMPLE_SEARCH' => $LANG['simple_search'], 'U_FORM_VALID' => url('../search/search.php#results'), 'C_SIMPLE_SEARCH' => $search_in == 'all' ? true : false, 'SEARCH_MODE_MODULE' => $search_in));
//------------------------------------------------------------- Other includes
require_once '../search/search.inc.php';
//----------------------------------------------------------------------- Main
$config = SearchConfig::load();
$modules_args = array();
$used_modules = array();
// Génération des formulaires précomplétés et passage aux templates
$provider_service = AppContext::get_extension_provider_service();
$search_extensions_point_modules = array_keys($provider_service->get_extension_point(SearchableExtensionPoint::EXTENSION_POINT));
$search_extensions_point = $provider_service->get_extension_point(SearchableExtensionPoint::EXTENSION_POINT);
foreach (ModulesManager::get_installed_modules_map_sorted_by_localized_name() as $id => $module) {
    if (in_array($module->get_id(), $search_extensions_point_modules)) {
        $module_configuration = $module->get_configuration();
        if (!in_array($module->get_id(), $config->get_all_unauthorized_providers())) {
            // Ajout du paramètre search à tous les modules
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:search.php

示例11: get_js_validation

 public function get_js_validation(FormField $field)
 {
     return 'lengthIntervalFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . $this->lower_bound . ', ' . $this->upper_bound . ', ' . TextHelper::to_js_string($this->error_message) . ')';
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:FormFieldConstraintLengthRange.class.php

示例12: escapejs

 /**
  * @desc Exports a variable to be used in a javascript script.
  * @param string $string A PHP string to convert to a JS one
  * @param string $add_quotes If true, returned string will be bounded by quotes
  * @return string The js equivalent string
  */
 public function escapejs($string, $add_quotes = true)
 {
     return TextHelper::to_js_string($string, $add_quotes);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:TemplateFunctions.class.php

示例13: get_js_validation

 public function get_js_validation(FormField $field)
 {
     return 'regexFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . $this->js_regex . ', ' . $this->js_options . ', ' . TextHelper::to_js_string($this->error_message) . ')';
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:FormFieldConstraintRegex.class.php

示例14: get_js_validation

 public function get_js_validation(FormField $field)
 {
     return 'notEmptyFormFieldValidator(' . TextHelper::to_js_string($field->get_id()) . ', ' . TextHelper::to_js_string(StringVars::replace_vars($this->error_message, array('name' => strtolower($field->get_label())))) . ')';
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:FormFieldConstraintNotEmpty.class.php

示例15: lateral_menu

        // When enabling it, the menu will be moved to this block location
        $block = $menu->get_block();
        // Disable the menu and move it to the disabled position computing new positions
        MenuService::move($menu, Menu::BLOCK_POSITION__NOT_ENABLED);
        // Restore its position and save it
        $menu->set_block($block);
        MenuService::save($menu);
    }
    MenuService::generate_cache();
    AppContext::get_response()->redirect('menus.php#m' . $menu->get_id());
}
// Display the Menu administration
include 'lateral_menu.php';
lateral_menu();
$tpl = new FileTemplate('admin/menus/links.tpl');
$tpl->put_all(array('L_NAME' => $LANG['name'], 'L_URL' => $LANG['url'], 'L_IMAGE' => LangLoader::get_message('form.picture', 'common'), 'L_STATUS' => $LANG['status'], 'L_HIDDEN_WITH_SMALL_SCREENS' => $LANG['hidden_with_small_screens'], 'L_AUTHS' => $LANG['auths'], 'L_ENABLED' => LangLoader::get_message('enabled', 'common'), 'L_DISABLED' => LangLoader::get_message('disabled', 'common'), 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_LOCATION' => $LANG['location'], 'L_ACTION_MENUS' => $menu_id > 0 ? $LANG['menus_edit'] : LangLoader::get_message('add', 'common'), 'L_ACTION' => $menu_id > 0 ? $LANG['update'] : $LANG['submit'], 'L_RESET' => $LANG['reset'], 'ACTION' => 'save', 'L_TYPE' => $LANG['type'], 'L_CONTENT' => $LANG['content'], 'L_AUTHORIZATIONS' => $LANG['authorizations'], 'L_ADD' => LangLoader::get_message('add', 'common'), 'L_REQUIRE_NAME' => $LANG['require_name'], 'J_AUTH_FORM' => str_replace(array("&quot;", "<!--", "-->"), array('"', "", ""), TextHelper::to_js_string(Authorizations::generate_select(Menu::MENU_AUTH_BIT, array('r-1' => Menu::MENU_AUTH_BIT, 'r0' => Menu::MENU_AUTH_BIT, 'r1' => Menu::MENU_AUTH_BIT), array(), 'menu_element_##UID##_auth'))), 'JL_AUTHORIZATIONS' => TextHelper::to_js_string($LANG['authorizations']), 'JL_PROPERTIES' => TextHelper::to_js_string($LANG['properties']), 'JL_NAME' => TextHelper::to_js_string($LANG['name']), 'JL_URL' => TextHelper::to_js_string($LANG['url']), 'JL_IMAGE' => TextHelper::to_js_string(LangLoader::get_message('form.picture', 'common')), 'JL_DELETE_ELEMENT' => TextHelper::to_js_string(LangLoader::get_message('confirm.delete', 'status-messages-common')), 'JL_MORE' => TextHelper::to_js_string($LANG['more_details']), 'JL_DELETE' => TextHelper::to_js_string(LangLoader::get_message('delete', 'common')), 'JL_ADD_SUB_ELEMENT' => TextHelper::to_js_string($LANG['add_sub_element']), 'JL_ADD_SUB_MENU' => TextHelper::to_js_string($LANG['add_sub_menu'])));
//Localisation possibles.
$block = retrieve(GET, 's', Menu::BLOCK_POSITION__HEADER, TINTEGER);
$array_location = array(Menu::BLOCK_POSITION__HEADER => $LANG['menu_header'], Menu::BLOCK_POSITION__SUB_HEADER => $LANG['menu_subheader'], Menu::BLOCK_POSITION__LEFT => $LANG['menu_left'], Menu::BLOCK_POSITION__TOP_CENTRAL => $LANG['menu_top_central'], Menu::BLOCK_POSITION__BOTTOM_CENTRAL => $LANG['menu_bottom_central'], Menu::BLOCK_POSITION__RIGHT => $LANG['menu_right'], Menu::BLOCK_POSITION__TOP_FOOTER => $LANG['menu_top_footer'], Menu::BLOCK_POSITION__FOOTER => $LANG['menu_footer']);
$edit_menu_tpl = new FileTemplate('admin/menus/menu_edition.tpl');
$edit_menu_tpl->put_all(array('L_NAME' => $LANG['name'], 'L_IMAGE' => LangLoader::get_message('form.picture', 'common'), 'L_URL' => $LANG['url'], 'L_PROPERTIES' => $LANG['properties'], 'L_AUTHORIZATIONS' => $LANG['authorizations'], 'L_ADD_SUB_ELEMENT' => $LANG['add_sub_element'], 'L_ADD_SUB_MENU' => $LANG['add_sub_menu'], 'L_MORE' => $LANG['more_details'], 'L_DELETE' => LangLoader::get_message('delete', 'common')));
$menu = null;
if ($menu_id > 0) {
    $menu = MenuService::load($menu_id);
    if (!$menu instanceof LinksMenu) {
        AppContext::get_response()->redirect('menus.php');
    }
    $block = $menu->get_block();
} else {
    // Create a new generic menu
    $menu = new LinksMenu('', '', '', LinksMenu::AUTOMATIC_MENU);
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:links.php


注:本文中的TextHelper::to_js_string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。