• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP eval_js函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中eval_js函数的典型用法代码示例。如果您正苦于以下问题:PHP eval_js函数的具体用法?PHP eval_js怎么用?PHP eval_js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: body

 public function body($params2 = array(), $def_account_id = null)
 {
     $accounts = Utils_RecordBrowserCommon::get_records('rc_accounts', array('epesi_user' => Acl::get_user()));
     $def = null;
     $user_def = null;
     $def_id = $this->get_module_variable('default', $def_account_id);
     foreach ($accounts as $a) {
         if ($def === null) {
             $def = $a;
         }
         if ($a['default_account']) {
             $user_def = $a;
         }
         if ($def_id === null && $a['default_account']) {
             $def = $a;
             break;
         } elseif ($a['id'] == $def_id) {
             $def = $a;
             break;
         }
     }
     foreach ($accounts as $a) {
         Base_ActionBarCommon::add('add', $a == $def ? '<b><u>' . $a['account_name'] . '</u></b>' : $a['account_name'], $this->create_callback_href(array($this, 'account'), $a['id']), $a['email'], $a == $user_def ? -1 : 0);
     }
     if ($def === null) {
         print '<h1><a ' . $this->create_callback_href(array($this, 'push_settings'), array(__('E-mail Accounts'))) . '>Please set your e-mail account</a></h1>';
         return;
     }
     $params = array('_autologin_id' => $def['id']) + $params2;
     //        if($params2) $params['_url'] = http_build_query($params2);
     print '<div style="background:transparent url(images/loader-0.gif) no-repeat 50% 50%;"><iframe style="border:0" border="0" src="modules/CRM/Roundcube/RC/index.php?' . http_build_query($params) . '" width="100%" height="300px" id="rc_frame"></iframe></div>';
     eval_js('var dim=document.viewport.getDimensions();var rc=$("rc_frame");rc.style.height=(Math.max(dim.height,document.documentElement.clientHeight)-130)+"px";');
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:33,代码来源:Roundcube_0.php


示例2: body

 public function body()
 {
     $t = $this->pack_module('Base/Theme');
     //caption
     $box_module = ModuleManager::get_instance('/Base_Box|0');
     if ($box_module) {
         $active_module = $box_module->get_main_module();
     }
     if ($active_module && is_callable(array($active_module, 'caption'))) {
         $caption = $active_module->caption();
         if (Variable::get('show_module_indicator')) {
             $t->assign('text', $caption);
         } else {
             $t->assign('text', '');
         }
         $show_caption = Variable::get('show_caption_in_title');
         $maintenance_mode = MaintenanceMode::is_on() ? ' (Maintenance mode)' : '';
         $base_title = Variable::get('base_page_title') . $maintenance_mode;
         if ($show_caption || strlen($base_title) > 0) {
             if ($show_caption && strlen($base_title) > 0) {
                 $caption = $base_title . ' - ' . $caption;
             } elseif (strlen($base_title) > 0) {
                 $caption = $base_title;
             }
             eval_js('document.title=\'' . addslashes($caption) . '\'');
         }
     } else {
         $t->assign('text', '');
         eval_js('document.title=\'' . addslashes(Variable::get('base_page_title')) . '\'');
     }
     $t->display();
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:32,代码来源:MainModuleIndicator_0.php


示例3: autohide_fields

 public static function autohide_fields($field, $field_type, $hide_mapping)
 {
     $allowed_modes = array('hide', 'show');
     $groups = array();
     foreach ($hide_mapping as $map) {
         if (!isset($map['fields']) || !isset($map['values'])) {
             continue;
         }
         $map['mode'] = isset($map['mode']) ? $map['mode'] : reset($allowed_modes);
         if (!in_array($map['mode'], $allowed_modes)) {
             continue;
         }
         $map['fields'] = is_array($map['fields']) ? $map['fields'] : array($map['fields']);
         $map['fields'] = array_map(function ($f) {
             return "#{$f}, #_{$f}__data";
         }, $map['fields']);
         $map['fields'] = implode(', ', $map['fields']);
         $map['values'] = is_array($map['values']) ? $map['values'] : array($map['values']);
         $map['values'] = array_map(function ($v) {
             if (is_bool($v)) {
                 $v = intval($v);
             }
             return strval($v);
         }, $map['values']);
         $groups[] = $map;
     }
     if (empty($groups)) {
         return;
     }
     load_js('modules/Libs/QuickForm/autohide_fields.js');
     $js_groups = json_encode($groups);
     eval_js("\n\t\t\t\tjq(function(){\n\t\t\t\t\tvar hide_ctrl = jq('#{$field}');\n\t\t\t\t\tLibs_QuickForm__hide_groups['{$field}']={$js_groups};\n\t\t\t\t\thide_ctrl.change(Libs_QuickForm__autohide).trigger('change');\n\t\t\t\t});");
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:33,代码来源:QuickFormCommon_0.php


示例4: toHtml

	function toHtml() {
		if(count($this->_cd)>1) {
			load_js('modules/Utils/CommonData/qf.js');
			$id=$this->getAttribute('id');
			if(!isset($id)) {
				$id = $this->getName();
				$this->updateAttributes(array('id'=>$id));
			}
			$val = $this->getValue();
			$val = $val[0];
			if($this->_flagFrozen) {
				eval_js('new Utils_CommonData_freeze(\''.Epesi::escapeJS($id,false).'\', \''.Epesi::escapeJS(json_encode($this->_cd),false).'\')');
				$html = '<span id="'.$id.'_label">&nbsp;</span>';
				$name = $this->getPrivateName();
				// Only use id attribute if doing single hidden input
				$html .= '<input' . $this->_getAttrString(array(
					     'type'  => 'hidden',
					     'name'  => $name,
					     'value' => $val,
					     'id'    => $id
					 )) . ' />';
				return $html;
			}
			eval_js('new Utils_CommonData(\''.Epesi::escapeJS($id,false).'\', \''.Epesi::escapeJS($val,false).'\', \''.Epesi::escapeJS(json_encode($this->_cd),false).'\', '.($this->_add_empty_fields?1:0).')');
		}
	        return parent::toHtml();
	}
开发者ID:62BRAINS,项目名称:EPESI,代码行数:27,代码来源:qf.php


示例5: toHtml

 function toHtml()
 {
     $str = "";
     if ($this->_flagFrozen) {
         $str .= $this->getFrozenHtml();
     } else {
         $value = $this->getAttribute('value');
         if (is_numeric($value)) {
             $value = date('Y-m-d', $value);
         }
         $id = $this->getAttribute('id');
         $name = $this->getAttribute('name');
         if ($value) {
             $this->setAttribute('value', Base_RegionalSettingsCommon::time2reg($value, false, true, false));
         }
         if (!isset($id)) {
             $id = 'datepicker_field_' . $name;
             $this->updateAttributes(array('id' => $id));
         }
         $ex_date = Base_RegionalSettingsCommon::time2reg(null, false, true, false);
         $date_format = Base_RegionalSettingsCommon::date_format();
         $this->setType('text');
         if (!$this->getAttribute('placeholder')) {
             $this->setAttribute('placeholder', __('Click to select date'));
         }
         $js = Utils_PopupCalendarCommon::create_href(md5($id), 'new Ajax.Request(\'modules/Utils/PopupCalendar/up.php\',' . '{method:\'post\', parameters:{date: __YEAR__+\'-\'+__MONTH__+\'-\'+__DAY__},' . 'onSuccess:function(t){e=$(\'' . Epesi::escapeJS($id, false) . '\');if(e) {e.value=t.responseText;jq(e).change();}}})', null, null, 'popup.clonePosition(\'' . $id . '\',{setWidth:false,setHeight:false,offsetTop:$(\'' . $id . '\').getHeight()})', $value, $id);
         $str .= $this->_getTabs() . '<input ' . $js . ' ' . $this->_getAttrString($this->_attributes) . ' ' . Utils_TooltipCommon::open_tag_attrs(__('Example date: %s', array($ex_date)), false) . ' />';
         eval_js('Event.observe(\'' . $id . '\',\'keypress\',Utils_PopupCalendarDatePicker.validate.bindAsEventListener(Utils_PopupCalendarDatePicker,\'' . Epesi::escapeJS($date_format, false) . '\'))');
         eval_js('Event.observe(\'' . $id . '\',\'blur\',Utils_PopupCalendarDatePicker.validate_blur.bindAsEventListener(Utils_PopupCalendarDatePicker,\'' . Epesi::escapeJS($date_format, false) . '\'))');
     }
     return $str;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:32,代码来源:datepicker.php


示例6: open

 public static function open($group, $params = array())
 {
     Libs_LeightboxCommon::open($group . '_prompt_leightbox');
     if (!empty($params)) {
         eval_js('f' . $group . '_set_params(\'' . implode('\',\'', $params) . '\');');
     }
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:LeightboxPromptCommon_0.php


示例7: submit_admin

 public function submit_admin($data)
 {
     Variable::set('default_theme', $data['theme']);
     Base_ThemeCommon::create_cache();
     Base_StatusBarCommon::message('Theme changed - reloading page');
     eval_js('setTimeout(\'document.location=\\\'index.php\\\'\',\'3000\')');
     return true;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:8,代码来源:Administrator_0.php


示例8: add

 public static function add($keys, $func, $opts = array())
 {
     if (isset($_REQUEST['__location']) && self::$clean !== $_REQUEST['__location'] || self::$clean === false) {
         self::$clean = isset($_REQUEST['__location']) ? $_REQUEST['__location'] : true;
         eval_js('shortcut.remove_all();');
     }
     $js = 'shortcut.add("' . implode('+', $keys) . '",' . $func . ',{';
     $js .= '\'type\':\'' . (isset($opts['type']) ? $opts['type'] : 'keydown') . '\',';
     $js .= '\'propagate\':' . (isset($opts['propagate']) ? $opts['propagate'] : 'false') . ',';
     $js .= '\'disable_in_input\':' . (isset($opts['disable_in_input']) ? $opts['disable_in_input'] : 'false') . ',';
     $js .= '\'target\':' . (isset($opts['target']) ? $opts['target'] : 'document');
     $js .= '});';
     eval_js($js);
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:14,代码来源:ShortcutCommon_0.php


示例9: create_href

 public static function create_href($name, $function = '', $mode = null, $first_day_of_week = null, $pos_js = null, $default = null, $id = null)
 {
     Base_ThemeCommon::load_css('Utils_PopupCalendar');
     load_js('modules/Utils/PopupCalendar/js/main2.js');
     load_js('modules/Utils/PopupCalendar/datepicker.js');
     if (!isset($mode)) {
         $mode = 'day';
     }
     if (!isset($first_day_of_week)) {
         if (Acl::is_user()) {
             $first_day_of_week = self::get_first_day_of_week();
         } else {
             $first_day_of_week = 0;
         }
     } elseif (!is_numeric($first_day_of_week)) {
         trigger_error('Invalid first day of week', E_USER_ERROR);
     }
     $calendar = '<div id="Utils_PopupCalendar">' . '<table cellspacing="0" cellpadding="0" border="0"><tr><td id="datepicker_' . $name . '_header">error</td></tr>' . '<tr><td id="datepicker_' . $name . '_view">calendar not loaded</td></tr></table></div>';
     $entry = 'datepicker_' . $name . '_calendar';
     $butt = $id === null ? 'datepicker_' . $name . '_button' : $id;
     $smarty = Base_ThemeCommon::init_smarty();
     $smarty->assign('calendar', $calendar);
     ob_start();
     Base_ThemeCommon::display_smarty($smarty, 'Utils_PopupCalendar');
     $cal_out = ob_get_clean();
     print '<div id="' . $entry . '" class="utils_popupcalendar_popup" style="display:none;z-index:2050;width:1px;">' . $cal_out . '</div>';
     if (!isset($pos_js)) {
         $pos_js = 'popup.clonePosition(\'' . $butt . '\',{setWidth:false,setHeight:false,offsetTop:$(\'' . $butt . '\').getHeight()});';
     }
     eval_js('if(Epesi.ie)$(\'' . $entry . '\').style.position="fixed";else $(\'' . $entry . '\').absolutize();');
     $ret = 'onClick="var popup=$(\'' . $entry . '\');' . $pos_js . ';$(\'' . $entry . '\').toggle()" href="javascript:void(0)" id="' . $butt . '"';
     $function .= ';$(\'' . $entry . '\').hide()';
     if ($default) {
         if (!is_numeric($default)) {
             $default = strtotime($default);
         }
         $args = date('Y', $default) . ',' . (date('n', $default) - 1) . ',' . date('d', $default);
     } else {
         $args = '';
     }
     $js = 'var datepicker_' . $name . ' = new Utils_PopupCalendar("' . Epesi::escapeJS($function, true, false) . '", \'' . $name . '\',\'' . $mode . '\',\'' . $first_day_of_week . '\',';
     $months = array(__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December'));
     $days = array(__('Sun'), __('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'));
     $js .= 'new Array(\'' . implode('\',\'', $months) . '\'),';
     $js .= 'new Array(\'' . implode('\',\'', $days) . '\')';
     $js .= ');' . 'datepicker_' . $name . '.show(' . $args . ')';
     eval_js($js);
     //		eval_js('$(\''.$entry.'\').absolutize();');
     return $ret;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:50,代码来源:PopupCalendarCommon_0.php


示例10: body

 public function body()
 {
     load_js('modules/Base/Help/js/canvasutilities.js');
     load_js('modules/Base/Help/js/main.js');
     eval_js('Helper.stop_tutorial_message = "' . Epesi::escapeJS('Tutorial was stopped') . '";');
     eval_js('setTimeout("Helper.get_all_help_hooks();", 500);');
     $theme = $this->init_module('Base_Theme');
     $theme->assign('href', 'href="javascript:void(0);" onclick="Helper.menu()"');
     $theme->assign('search_placeholder', __('Start typing to search help topics'));
     $theme->assign('label', __('Help'));
     Utils_ShortcutCommon::add(array('esc'), 'function(){Helper.escape();}');
     Utils_ShortcutCommon::add(array('f1'), 'function(){Helper.menu();}');
     $theme->display();
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:14,代码来源:Help_0.php


示例11: generate_query_builder

 protected function generate_query_builder()
 {
     $this->load_libs();
     $this->init_form();
     $this->options['filters'] = $this->filters;
     if ($this->plugins) {
         $this->options['plugins'] = $this->plugins;
     }
     $options_json = json_encode($this->options);
     $rules_json = $this->rules ? json_encode($this->rules) : json_encode(self::$empty_rules);
     $error_msg = __('Please fix query builder rules');
     $error_msg = json_encode($error_msg);
     eval_js("Utils_QueryBuilder('{$this->form->get_name()}', '{$this->form_element_id}', '{$this->instance_id}', {$options_json}, {$rules_json}, {$error_msg});");
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:14,代码来源:QueryBuilder_0.php


示例12: applet

 public function applet($values, &$opts)
 {
     //available applet options: toggle,href,title,go,go_function,go_arguments,go_contruct_arguments
     Base_ThemeCommon::load_css('Applets_Weather');
     $opts['title'] = __('Weather');
     $rssfeed = $values['rssfeed'] . '?p=' . $values['zipcode'] . '&u=' . $values['temperature'];
     $name = md5($this->get_path() . $rssfeed);
     //div for updating
     print '<div id="Applets_Weather"><div id="rssfeed_' . $name . '"><span>' . __('Loading Weather...') . '</span></div></div>';
     //interval execution
     eval_js_once('var rssfeedcache = Array();' . 'rssfeedfunc = function(name,fee,num,cache){' . 'if(!$(\'rssfeed_\'+name)) return;' . 'if(cache && typeof rssfeedcache[name] != \'undefined\')' . '$(\'rssfeed_\'+name).innerHTML = rssfeedcache[name];' . 'else ' . 'new Ajax.Updater(\'rssfeed_\'+name,\'modules/Applets/Weather/refresh.php\',{' . 'method:\'post\',' . 'onComplete:function(r){rssfeedcache[name]=r.responseText},' . 'parameters:{feed:fee, number:num, cid: Epesi.client_id}});' . '}');
     eval_js_once('setInterval(\'rssfeedfunc(\\\'' . $name . '\\\',\\\'' . Epesi::escapeJS($rssfeed, false) . '\\\' , 2 , 0)\',1799993)');
     //29 minutes and 53 seconds
     //get rss now!
     eval_js('rssfeedfunc(\'' . $name . '\',\'' . Epesi::escapeJS($rssfeed, false) . '\' , 2 , 1)');
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:16,代码来源:Weather_0.php


示例13: body

 public function body($skin, $size = 200)
 {
     print '<center' . ($skin == 'chunkySwissOnBlack' ? ' style="background-color:black; color:white;"' : '') . '>';
     $browser = stripos($_SERVER['HTTP_USER_AGENT'], 'msie');
     if ($browser !== false || $skin == 'flash') {
         $size *= 2;
         //clock taken from http://www.kirupa.com/developer/actionscript/clock.htm
         $clock = $this->get_module_dir() . 'clock.swf';
         print '<center><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="' . $size . '" width="' . $size . '">' . '<param name="movie" value="' . $clock . '">' . '<param name="quality" value="high">' . '<param name="wmode" value="transparent">' . '<param name="menu" value="false">' . '<embed src="' . $clock . '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" height="' . $size . '" width="' . $size . '">' . '</object></center>';
     } else {
         load_js($this->get_module_dir() . 'coolclock.js');
         eval_js('CoolClock.findAndCreateClocks()');
         print '<canvas id="' . $this->get_path() . 'canvas" class="CoolClock:' . $skin . ':' . $size . '"></canvas>';
     }
     print '<BR>' . Base_RegionalSettingsCommon::time2reg(null, false) . '</center>';
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:16,代码来源:Clock_0.php


示例14: load_image_cache

 private function load_image_cache()
 {
     if (isset($_SESSION['client']['image_cache'])) {
         return;
     }
     $_SESSION['client']['image_cache'] = true;
     $imgs = array();
     if (Variable::get('preload_image_cache_selected') && file_exists($this->get_data_dir() . 'templates/' . self::$theme . '/__cache.images')) {
         $imgs = explode("\n", file_get_contents($this->get_data_dir() . 'templates/' . self::$theme . '/__cache.images'));
     }
     if (Variable::get('preload_image_cache_default') && self::$theme != 'default' && file_exists($this->get_data_dir() . 'templates/' . 'default/__cache.images')) {
         $imgs = array_merge($imgs, explode("\n", file_get_contents($this->get_data_dir() . 'templates/' . 'default/__cache.images')));
     }
     if (!empty($imgs)) {
         eval_js("var cache = document.createElement('div');" . "cache.style.display='none';" . "document.body.appendChild(cache);" . "var current_image = null;" . "var cache_pause = false;" . "var images_list = Array('" . implode("','", $imgs) . "');" . "cache_images = function() {" . "if(!cache_pause && (current_image==null || current_image.complete)) {" . "current_image = document.createElement('img');" . "current_image.src = images_list.shift();" . "cache.appendChild(current_image);" . "}" . "if(images_list.length)" . "setTimeout('cache_images()',500);" . "};" . "cache_images();", false);
     }
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:17,代码来源:Theme_0.php


示例15: applet

 public function applet($values, &$opts)
 {
     //available applet options: toggle,href,title,go,go_function,go_arguments,go_contruct_arguments
     if (!$values['title']) {
         $values['title'] = __('RSS Feed');
     }
     $opts['title'] = $values['title'];
     $name = md5($this->get_path() . $values['rssfeed']);
     //div for updating
     print '<div id="rssfeed_' . $name . '" style="width: 270px; padding: 5px 5px 5px 20px;">' . __('Loading RSS...') . '</div>';
     //interval execution
     eval_js_once('var rssfeedcache = Array();' . 'rssfeedfunc = function(name,fee,num,cache){' . 'if(!$(\'rssfeed_\'+name)) return;' . 'if(cache && typeof rssfeedcache[name] != \'undefined\')' . '$(\'rssfeed_\'+name).innerHTML = rssfeedcache[name];' . 'else ' . 'new Ajax.Updater(\'rssfeed_\'+name,\'modules/Applets/RssFeed/refresh.php\',{' . 'method:\'post\',' . 'onComplete:function(r){rssfeedcache[name]=r.responseText},' . 'parameters:{feed:fee, number:num, cid: Epesi.client_id}});' . '}');
     eval_js_once('setInterval(\'rssfeedfunc(\\\'' . $name . '\\\',\\\'' . Epesi::escapeJS($values['rssfeed'], false) . '\\\' ,' . $values['rssnumber'] . ' , 0)\',1799993)');
     //29 minutes and 53 seconds
     //get rss now!
     eval_js('rssfeedfunc(\'' . $name . '\',\'' . Epesi::escapeJS($values['rssfeed'], false) . '\' ,' . $values['rssnumber'] . ' , 1)');
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:17,代码来源:RssFeed_0.php


示例16: create

 public static function create($dest_id, array $prev_ids, $req_url, array $params = null, $default_val = null)
 {
     load_js('modules/Utils/ChainedSelect/cs.js');
     if (empty($prev_ids)) {
         trigger_error('Chained select can exists only with previous selects', E_USER_ERROR);
     }
     if ($params === null) {
         $params = array();
     }
     if ($default_val === null) {
         $default_val = '';
     }
     $js = 'var params = new Hash();';
     $_SESSION['client']['utils_chainedselect'][$dest_id] = $req_url;
     foreach ($params as $k => $v) {
         $js .= 'params.set("' . $k . '","' . $v . '");';
     }
     eval_js($js . 'new ChainedSelect("' . $dest_id . '",new Array("' . implode('","', $prev_ids) . '"),params, "' . $default_val . '")');
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:19,代码来源:ChainedSelectCommon_0.php


示例17: toHtml

	function toHtml() {
		$str = "";
		if ($this->_flagFrozen) {
			$str .= $this->getFrozenHtml();
		} else {
			$id = $this->getAttribute('id');
			$name = $this->getAttribute('name');
			if(!isset($id)) {
				$id = 'currency_field_'.$name;
				$this->updateAttributes(array('id'=>$id));
			}
			
			$this->dec_digits = DB::GetOne('SELECT MAX(decimals) FROM utils_currency');

			$str .= $this->_getTabs() . '<div style="position: relative;">';

			$str .= $this->_getTabs() .
					'<div style="margin-right:45px;" class="currency_amount"><input ' . $this->_getAttrString($this->_attributes) . ' '.
					Utils_TooltipCommon::open_tag_attrs(__('Example value: %s',array('123'.Utils_CurrencyFieldCommon::get_decimal_point().implode('',range(4,3+$this->dec_digits)))), false ).
					' /></div>';

			$str .= $this->_getTabs() .
					'<div style="margin-right:5px; width:40px; position:absolute;top:0px;right:0px;"><select style="width:40px;" name="__'.str_replace(array('[',']'),'',$name).'__currency" id="__'.$id.'__currency">';

			$curs = DB::GetAll('SELECT id, symbol, active FROM utils_currency ORDER BY code');
			foreach ($curs as $v) {
				if ($v['id']!=$this->currency && !$v['active']) continue;
				$str .= '<option value="'.$v['id'].'"';
				if ($v['id']==$this->currency) $str .= ' selected="1"';
				$str .= '>'.$v['symbol'].'</option>';
			}
			$str .= '</select></div>';

			$str .= $this->_getTabs() . '</div>';

			load_js('modules/Utils/CurrencyField/currency.js');
			$curr_format = '-?([0-9]*)\\'.Utils_CurrencyFieldCommon::get_decimal_point().'?[0-9]{0,'.$this->dec_digits.'}';
			eval_js('Event.observe(\''.$id.'\',\'keypress\',Utils_CurrencyField.validate.bindAsEventListener(Utils_CurrencyField,\''.Epesi::escapeJS($curr_format,false).'\'))');
			eval_js('Event.observe(\''.$id.'\',\'blur\',Utils_CurrencyField.validate_blur.bindAsEventListener(Utils_CurrencyField,\''.Epesi::escapeJS($curr_format,false).'\'))');
		}
		return $str;
	} //end func toHtml
开发者ID:62BRAINS,项目名称:EPESI,代码行数:42,代码来源:currency.php


示例18: toHtml

 function toHtml()
 {
     if ($this->_flagFrozen) {
         return $this->getFrozenHtml();
     } else {
         $name = $this->getAttribute('name');
         $id = $this->getAttribute('id');
         if (!$id) {
             $id = '__autocomplete_id_' . $name;
             $this->setAttribute('id', $id);
         }
         $key = md5(serialize($this->callback) . $id);
         $_SESSION['client']['quickform']['autocomplete'][$key] = array('callback' => $this->callback, 'field' => $name, 'args' => $this->args);
         eval_js('var epesi_autocompleter = new Ajax.Autocompleter(\'' . $id . '\', \'' . $id . '_suggestbox\', \'modules/Libs/QuickForm/FieldTypes/autocomplete/autocomplete_update.php?' . http_build_query(array('cid' => CID, 'key' => $key)) . '\', {frequency: 0.6});');
         // TODO: not really neat, need to extend the function automatically
         if ($this->on_hide_js_code) {
             eval_js('epesi_autocompleter.hide=function(){' . 'this.stopIndicator();' . 'if (Element.getStyle(this.update, "display") != "none") {' . '    this.options.onHide(this.element, this.update);' . '}' . 'if (this.iefix) {' . '    Element.hide(this.iefix);' . '}' . $this->on_hide_js_code . '}');
         }
         return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />' . '<div id="' . $id . '_suggestbox" class="autocomplete">&nbsp;</div>';
     }
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:21,代码来源:autocomplete.php


示例19: body

    public function body($file = null, $callback = null)
    {
        if (!isset($file)) {
            if (!isset($this->file)) {
                trigger_error('You have to specify file to download', E_USER_ERROR);
            }
            $file = $this->file;
        }
        if (!isset($callback)) {
            if (!isset($this->callback)) {
                trigger_error('You have to specify callback to call on download complete', E_USER_ERROR);
            }
            $callback = $this->callback;
        }
        if (isset($_REQUEST['download_complete_' . $this->get_path()])) {
            $did = $this->get_module_variable('download_id');
            $dd = $this->get_data_dir();
            if (!isset($did) || !file_exists($dd . $did . '.tmp')) {
                print 'Download error.';
            } else {
                DB::Execute('DELETE FROM utils_filedownload_files WHERE id=%d', array($did));
                $tf = $dd . $did . '.tmp';
                call_user_func($callback, $tf, basename($file));
                @unlink($tf);
            }
            return;
        }
        $path = $this->get_path();
        $id = $this->create_unique_key('stat');
        print '<div id="' . $id . '"></div>';
        eval_js_once('utils_filedownload_refresh = function(id,path){var stat=$(id);if(!stat || stat.innerHTML==\'Processing downloaded file\') return;' . 'new Ajax.Updater(id,\'' . $this->get_module_dir() . 'refresh.php\',{method:\'post\', parameters:{path: path}});' . 'setTimeout("utils_filedownload_refresh(\'"+id+"\',\'"+path+"\')",3000);}');
        eval_js_once('utils_filedownload_check_completed = function(id){stat=document.getElementById(id);' . 'if(stat && stat.innerHTML==\'Finished\'){
					stat.innerHTML=\'Processing downloaded file\';' . $this->create_href_js(array('download_complete_' . $this->get_path() => 1), __('Download finished'), 'queue') . '}setTimeout(\'utils_filedownload_check_completed("\'+id+\'")\',500);}');
        DB::Execute('INSERT INTO utils_filedownload_files(path,size) VALUES (%s,-1)', array($file));
        $this->set_module_variable('download_id', DB::Insert_ID('utils_downloadfile_files', 'id'));
        print '<iframe src="' . $this->get_module_dir() . 'download.php?' . http_build_query(array('client_id' => CID, 'path' => $path)) . '"  width=0 height=0 frameborder=0>';
        eval_js('utils_filedownload_refresh("' . $id . '","' . $path . '");utils_filedownload_check_completed("' . $id . '")');
    }
开发者ID:cretzu89,项目名称:EPESI,代码行数:38,代码来源:FileDownload_0.php


示例20: browse

 /**
  * For internal use only.
  */
 public function browse($name = '', $root = true)
 {
     if ($this->is_back()) {
         return false;
     }
     if (isset($_REQUEST['node_position'])) {
         list($node_id, $position) = $_REQUEST['node_position'];
         Utils_CommonDataCommon::change_node_position($node_id, $position);
     }
     $gb = $this->init_module(Utils_GenericBrowser::module_name(), null, 'browse' . md5($name));
     $gb->set_table_columns(array(array('name' => __('Position'), 'width' => 5, 'order' => 'position'), array('name' => __('Key'), 'width' => 20, 'order' => 'akey', 'search' => 1, 'quickjump' => 'akey'), array('name' => __('Value'), 'width' => 20, 'order' => 'value', 'search' => 1)));
     print '<h2>' . $name . '</h2><br>';
     $ret = Utils_CommonDataCommon::get_translated_array($name, true, true);
     foreach ($ret as $k => $v) {
         $gb_row = $gb->get_new_row();
         $gb_row->add_data($v['position'], $k, $v['value']);
         // ****** CommonData value translation
         $gb_row->add_action($this->create_callback_href(array($this, 'browse'), array($name . '/' . $k, false)), 'View');
         if (!$v['readonly']) {
             $gb_row->add_action($this->create_callback_href(array($this, 'edit'), array($name, $k)), 'Edit');
             $gb_row->add_action($this->create_confirm_callback_href(__('Delete array') . ' \'' . Epesi::escapeJS($name . '/' . $k, false) . '\'?', array('Utils_CommonData', 'remove_array'), array($name . '/' . $k)), 'Delete');
         }
         $node_id = $v['id'];
         $gb_row->add_action('class="move-handle"', 'Move', __('Drag to change node order'), 'move-up-down');
         $gb_row->set_attrs("node=\"{$node_id}\" class=\"sortable\"");
     }
     $gb->set_default_order(array(__('Position') => 'ASC'));
     //$this->display_module($gb);
     $this->display_module($gb, array(true), 'automatic_display');
     // sorting
     load_js($this->get_module_dir() . 'sort_nodes.js');
     $table_md5 = md5($gb->get_path());
     eval_js("utils_commondata_sort_nodes_init(\"{$table_md5}\")");
     Base_ActionBarCommon::add('settings', __('Reset Order By Key'), $this->create_callback_href(array('Utils_CommonDataCommon', 'reset_array_positions'), $name));
     Base_ActionBarCommon::add('add', __('Add array'), $this->create_callback_href(array($this, 'edit'), $name));
     if (!$root) {
         Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     }
     return true;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:43,代码来源:CommonData_0.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eve函数代码示例发布时间:2022-05-15
下一篇:
PHP eval_html函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap