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


PHP JSession::getId方法代码示例

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


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

示例1: testGetId

 /**
  * Test getId
  *
  * @covers  JSession::getId
  *
  * @return void
  */
 public function testGetId()
 {
     $this->assertEquals(session_id(), $this->object->getId(), 'Session ids should match.');
 }
开发者ID:N6REJ,项目名称:joomla-cms,代码行数:11,代码来源:JSessionTest.php

示例2: getInput

    protected function getInput()
    {
        $moduleID = intval($this->form->getValue('id'));
        $moduleURL = JURI::root() . 'modules/mod_bt_apb';
        $class = $this->element['class'] ? (string) $this->element['class'] : '';
        $html = '
		<div id="bt-drop-area" class="dropbox ' . $class . '">
			<div class="select-button">
				<input name="images[]" type="file" id="bt-input-file" multiple="multiple"/>
				<span>' . JText::_('SELECT_IMAGES') . '</span>
			</div>
			<p>' . JText::_('DRAG_AND_DROP_TO_UPLOAD') . '</p>
		</div>
		<script type="text/javascript">
		jQuery(document).ready(function($){	
			$("#bt-drop-area").filedrop({
				paramname: "bt_images",
				maxfiles: 10,
				maxfilesize: 2,
				url: "' . JURI::root() . 'administrator/index.php",
				data: {
					"action" : "upload",
					"option" : "com_modules",
					"view" :  "module",
					"layout" : "edit",
					"id" : ' . $moduleID . ',
					"' . JSession::getName() . '": "' . JSession::getId() . '",
					"' . JSession::getFormToken() . '" : 1
				},	
				
				
				error: function(err, file) {
					switch(err) {
						case "BrowserNotSupported":
							BTSlideshow.showMessage("#btss-message", "Your browser does not support HTML5 file uploads!");
							break;
						case "TooManyFiles":
							BTSlideshow.showMessage("#btss-message", "Too many files! Please select 5 at most!");
							break;
						case "FileTooLarge":
							BTSlideshow.showMessage("#btss-message", file.name+ " is too large! Please upload files up to 2MB.");
							break;
						default:
							break;
					}
					inProgess = false;
					BTSlideshow.removeLog();
				},
				drop: function() {
					inProgess = true;
					BTSlideshow.showMessage("#btss-message", "Loading images... <span class=\\"btss-upload-spinner\\"></span>");
				},
				// Called before each upload is started
				beforeEach: function(file){
					if(!file.type.match(/^image\\//)){
						BTSlideshow.showMessage("#btss-message", file.name + " can\'t be uploaded. Only images are allowed!");
						inProgess = false;
						BTSlideshow.removeLog();
						return false;
					}
					
				},
				uploadStarted:function(i, file, len){
					BTSlideshow.showMessage("#btss-message", "<div id=\\"btss-upload-file-" + i + "\\">Loading <b>" + file.name + "</b><span class=\\"btss-upload-spinner\\"></span></div>");
				},
				uploadFinished: function(i, file, response, time) {					
					if (!response.success) {
						jQuery("#btss-upload-file-"+i).append("<span style=\\"color: red;\\"> " + response.message +"</span>");
					}
					else {
						var file = response.files;
						var item = {
							  file: file.filename,
							  title: file.title
						};
						BTSlideshow.add(item, true);
						jQuery("#btss-upload-file-"+i).append("<span style=\\"color: green;\\"> Completed</span>");
					}
											
				},
				
				afterAll: function(){
					inProgess = false;
					BTSlideshow.removeLog();
				}
				 
			});
			
			//select files
			jQuery("#bt-input-file").change(function (e) {  
				var i = 0, len = this.files.length, reader, file, formdata;  
				
				inProgess = true;
				
				jQuery("#bt-input-file").parent().addClass("disabled");
				jQuery("#bt-input-file").next("span").html("Uploading...");
				jQuery("#bt-input-file").attr("disabled", "disabled");
				
				BTSlideshow.showMessage("#btss-message", "Loading images... <span class=\\"btss-upload-spinner\\"></span>");
                
//.........这里部分代码省略.........
开发者ID:esorone,项目名称:efcpw,代码行数:101,代码来源:html5upload.php


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