From 911e0eb0501799eb2532b3610c1066d606dc180e Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 10 Sep 2008 07:11:47 +0000 Subject: [PATCH] MDL-13766 1. change css className 2. add comments --- lib/boxlib.php | 10 ++-- lib/editor/tinymce.js.php | 1 + lib/form/filepicker.php | 1 + repository/lib.php | 104 ++++++++++++++++++-------------------- repository/ws.php | 2 + 5 files changed, 57 insertions(+), 61 deletions(-) diff --git a/lib/boxlib.php b/lib/boxlib.php index 14aec630e3..8dc56e4f7d 100755 --- a/lib/boxlib.php +++ b/lib/boxlib.php @@ -1,4 +1,9 @@ + * @version: $Id$ + */ + /** * Box REST Client Library for PHP5 Developers * @@ -12,11 +17,6 @@ * Go to http://www.gnu.org/licenses/gpl-3.0.txt for full text */ -/** - * Modified by Dongsheng Cai - * - */ - class boxclient { public $auth_token = ''; diff --git a/lib/editor/tinymce.js.php b/lib/editor/tinymce.js.php index 179034a6e6..970f31c548 100644 --- a/lib/editor/tinymce.js.php +++ b/lib/editor/tinymce.js.php @@ -221,6 +221,7 @@ $output .= << -#panel-$suffix{padding:0;margin:0; text-align:left;} -#file-picker-$suffix{font-size:12px;} -#file-picker-$suffix strong{background:#FFFFCC} -#file-picker-$suffix a{color: #336699} -#file-picker-$suffix a:hover{background:#003366;color:white} -#repo-viewbar-$suffix{width:300px;float:left} -#search-div-$suffix{float:right} -#repo-tb-$suffix{padding: .8em;background: #FFFFCC;color:white;text-align:center} - -EOD; - + $css = ''; if (!isset($CFG->repo_yui_loaded)) { $css .= << -.repo-list{list-style-type:none;padding:0} -.repo-list li{border-bottom:1px dotted gray;margin-bottom: 1em;} -.repo-name{display:block;padding: 3px;margin-bottom: 5px} -.paging{margin:10px 5px; clear:both;} -.paging a{padding: 4px;border: 1px solid #CCC} -.repo-path{margin: 4px;border-bottom: 1px dotted gray;} -.repo-path a{padding: 4px;} -.rename-form{text-align:center} -.rename-form p{margin: 1em;} -.upload-form{margin: 2em 0;text-align:center} -p.upload a{font-size: 14px;background: #ccc;color:white;padding: 5px} -p.upload a:hover {background: grey;color:white} -.file_name{color:green;} -.file_date{color:blue} -.file_size{color:gray} -.grid{width:80px; float:left;text-align:center;} -.grid div{width: 80px; overflow: hidden} -.grid p{margin:0;padding:0;background: #FFFFCC} -.grid .label{height:48px} -.grid span{background: #EEF9EB;color:gray} - - + EOD; $js = <<'); - panel.beforeRenderEvent.subscribe(function() { + filepicker.setHeader('$strtitle'); + filepicker.setBody('
'); + filepicker.beforeRenderEvent.subscribe(function() { Event.onAvailable('layout-$suffix', function() { layout = new YAHOO.widget.Layout('layout-$suffix', { height: 480, width: 630, units: [ {position: 'top', height: 32, resize: false, - body:'
', gutter: '2'}, + body:'
', gutter: '2'}, {position: 'left', width: 200, resize: true, - body:'
    ', gutter: '0 5 0 2', minWidth: 150, maxWidth: 300 }, - {position: 'center', body: '
    ', + body:'
      ', gutter: '0 5 0 2', minWidth: 150, maxWidth: 300 }, + {position: 'center', body: '
      ', scroll: true, gutter: '0 2 0 0' } ] }); @@ -1350,7 +1344,7 @@ function _client(){ layout.set('width', (args.width - PANEL_BODY_PADDING)); layout.resize(); - }, panel, true); + }, filepicker, true); _client.viewbar = new YAHOO.widget.ButtonGroup({ id: 'btngroup-$suffix', name: 'buttons', @@ -1360,14 +1354,14 @@ function _client(){ } // public method this.show = function(){ - panel.show(); + filepicker.show(); } this.hide = function(){ - panel.hide(); + filepicker.hide(); } this.create_picker = function(){ // display UI - panel.render(); + filepicker.render(); _client.viewbar.addButtons([btn_list, btn_thumb]); // init repository list repo_list = new YAHOO.util.Element('repo-list-$suffix'); @@ -1380,7 +1374,6 @@ function _client(){ var panel = new YAHOO.util.Element('panel-$suffix'); try { if(!o.responseText){ - var panel = new YAHOO.util.Element('panel-$suffix'); panel.get('element').innerHTML = 'no'; return; } @@ -1390,7 +1383,6 @@ function _client(){ } _client.ds = {}; if(!json.list || json.list.length<1){ - var panel = new YAHOO.util.Element('panel-$suffix'); panel.get('element').innerHTML = 'no'; return; } @@ -1431,7 +1423,7 @@ function _client(){ link.href = '###'; link.id = 'repo-call-$suffix-'+repo.id; link.appendChild(icon); - link.className = 'repo-name'; + link.className = 'fp-repo-name'; link.onclick = function(){ var re = /repo-call-$suffix-(\d+)/i; var id = this.id.match(re); @@ -1491,7 +1483,7 @@ _client.loading = function(type, name){ } _client.rename = function(oldname, url, icon, repo_id){ var panel = new YAHOO.util.Element('panel-$suffix'); - var html = '
      '; + var html = '
      '; _client.repositoryid=repo_id; html += '

      '; html += '

      '; @@ -1552,7 +1544,7 @@ _client.viewfiles = function(){ _client.print_header = function(){ var panel = new YAHOO.util.Element('panel-$suffix'); var str = ''; - str += '

      '; + str += '
      '; panel.set('innerHTML', str); _client.makepath(); } @@ -1618,7 +1610,7 @@ _client.viewthumb = function(ds){ var count = 0; for(k in list){ var el = document.createElement('div'); - el.className='grid'; + el.className='fp-grid'; var frame = document.createElement('DIV'); frame.style.textAlign='center'; var img = document.createElement('img'); @@ -1800,11 +1792,11 @@ _client.upload_cb = { _client.uploadcontrol = function() { var str = ''; if(_client.ds.upload){ - str += '