MDL-38903 File picker: making upload form with more semantic HTML

This commit is contained in:
Jason Fowler 2014-01-17 11:23:59 +08:00
parent ec4c8161a4
commit 88d366e595
8 changed files with 386 additions and 178 deletions

View File

@ -201,18 +201,30 @@ class core_files_renderer extends plugin_renderer_base {
<div class="fp-navbar">
<div class="filemanager-toolbar">
<div class="fp-toolbar">
<div class="{!}fp-btn-add"><a role="button" title="'.$straddfile.'" href="#"><img src="'.$this->pix_url('a/add_file').'" alt="" /></a></div>
<div class="{!}fp-btn-mkdir"><a role="button" title="'.$strmakedir.'" href="#"><img src="'.$this->pix_url('a/create_folder').'" alt="" /></a></div>
<div class="{!}fp-btn-download"><a role="button" title="'.$strdownload.'" href="#"><img src="'.$this->pix_url('a/download_all').'" alt="" /></a></div>
<div class="fp-btn-add">
<a role="button" title="'.$straddfile.'" href="#"><img src="'.$this->pix_url('a/add_file').'" alt="" /></a>
</div>
<div class="fp-btn-mkdir">
<a role="button" title="'.$strmakedir.'" href="#"><img src="'.$this->pix_url('a/create_folder').'" alt="" /></a>
</div>
<div class="fp-btn-download">
<a role="button" title="'.$strdownload.'" href="#"><img src="'.$this->pix_url('a/download_all').'" alt="" /></a>
</div>
</div>
<div class="{!}fp-viewbar">
<a title="'. get_string('displayicons', 'repository') .'" class="{!}fp-vb-icons" href="#"><img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" /></a>
<a title="'. get_string('displaydetails', 'repository') .'" class="{!}fp-vb-details" href="#"><img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" /></a>
<a title="'. get_string('displaytree', 'repository') .'" class="{!}fp-vb-tree" href="#"><img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" /></a>
<div class="fp-viewbar">
<a title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#">
<img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" />
</a>
<a title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#">
<img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" />
</a>
<a title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#">
<img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" />
</a>
</div>
</div>
<div class="fp-pathbar">
<span class="{!}fp-path-folder"><a class="{!}fp-path-folder-name" href="#"></a></span>
<span class="fp-path-folder"><a class="fp-path-folder-name" href="#"></a></span>
</div>
</div>
<div class="filemanager-loading mdl-align">'.$icon_progress.'</div>
@ -249,17 +261,17 @@ class core_files_renderer extends plugin_renderer_base {
<div class="fp-file">
<a href="#">
<div style="position:relative;">
<div class="{!}fp-thumbnail"></div>
<div class="fp-thumbnail"></div>
<div class="fp-reficons1"></div>
<div class="fp-reficons2"></div>
</div>
<div class="fp-filename-field">
<div class="{!}fp-filename"></div>
<div class="fp-filename"></div>
</div>
</a>
<a class="{!}fp-contextmenu" href="#">'.$this->pix_icon('i/menu', '').'</a>
<a class="fp-contextmenu" href="#">'.$this->pix_icon('i/menu', '').'</a>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -279,14 +291,14 @@ class core_files_renderer extends plugin_renderer_base {
$rv = '
<span class="fp-filename-icon">
<a href="#">
<span class="{!}fp-icon"></span>
<span class="fp-icon"></span>
<span class="fp-reficons1"></span>
<span class="fp-reficons2"></span>
<span class="{!}fp-filename"></span>
<span class="fp-filename"></span>
</a>
<a class="{!}fp-contextmenu" href="#" onclick="return false;">'.$this->pix_icon('i/menu', '').'</a>
<a class="fp-contextmenu" href="#" onclick="return false;">'.$this->pix_icon('i/menu', '').'</a>
</span>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -309,10 +321,10 @@ class core_files_renderer extends plugin_renderer_base {
<label id="fp-mkdir-dlg-title">' . get_string('newfoldername', 'repository') . '</label><br/>
<input type="text" />
</div>
<button class="{!}fp-dlg-butcreate">'.get_string('makeafolder').'</button>
<button class="{!}fp-dlg-butcancel">'.get_string('cancel').'</button>
<button class="fp-dlg-butcreate btn-primary">'.get_string('makeafolder').'</button>
<button class="fp-dlg-butcancel btn-cancel">'.get_string('cancel').'</button>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -369,50 +381,78 @@ class core_files_renderer extends plugin_renderer_base {
private function fm_js_template_fileselectlayout() {
global $OUTPUT;
$strloading = get_string('loading', 'repository');
$icon_progress = $this->pix_icon('i/loading_small', $strloading).'';
$iconprogress = $this->pix_icon('i/loading_small', $strloading).'';
$rv = '
<div class="filemanager fp-select">
<div class="fp-select-loading">
<img src="'.$this->pix_url('i/loading_small').'" />
</div>
<form>
<button class="{!}fp-file-download">'.get_string('download').'</button>
<button class="{!}fp-file-delete">'.get_string('delete').'</button>
<button class="{!}fp-file-setmain">'.get_string('setmainfile', 'repository').'</button><span class="fp-file-setmain-help">'.$OUTPUT->help_icon('setmainfile', 'repository').'</span>
<button class="{!}fp-file-zip">'.get_string('zip', 'editor').'</button>
<button class="{!}fp-file-unzip">'.get_string('unzip').'</button>
<form class="form-horizontal">
<button class="fp-file-download">'.get_string('download').'</button>
<button class="fp-file-delete">'.get_string('delete').'</button>
<button class="fp-file-setmain">'.get_string('setmainfile', 'repository').'</button>
<span class="fp-file-setmain-help">'.$OUTPUT->help_icon('setmainfile', 'repository').'</span>
<button class="fp-file-zip">'.get_string('zip', 'editor').'</button>
<button class="fp-file-unzip">'.get_string('unzip').'</button>
<div class="fp-hr"></div>
<table>
<tr class="{!}fp-saveas"><td class="mdl-right"><label>'.get_string('name', 'moodle').'</label>:</td>
<td class="mdl-left"><input type="text"/></td></tr>
<tr class="{!}fp-author"><td class="mdl-right"><label>'.get_string('author', 'repository').'</label>:</td>
<td class="mdl-left"><input type="text"/></td></tr>
<tr class="{!}fp-license"><td class="mdl-right"><label>'.get_string('chooselicense', 'repository').'</label>:</td>
<td class="mdl-left"><select></select></td></tr>
<tr class="{!}fp-path"><td class="mdl-right"><label>'.get_string('path', 'moodle').'</label>:</td>
<td class="mdl-left"><select></select></td></tr>
<tr class="{!}fp-original"><td class="mdl-right"><label>'.get_string('original', 'repository').'</label>:</td>
<td class="mdl-left"><span class="fp-originloading">'.$icon_progress.' '.$strloading.'</span><span class="fp-value"></span></td></tr>
<tr class="{!}fp-reflist"><td class="mdl-right"><label>'.get_string('referenceslist', 'repository').'</label>:</td>
<td class="mdl-left"><p class="{!}fp-refcount"></p><span class="fp-reflistloading">'.$icon_progress.' '.$strloading.'</span><ul class="fp-value"></ul></td></tr>
</table>
<div class="fp-forminset">
<div class="fp-saveas control-group clearfix">
<label class="control-label">'.get_string('name', 'repository').'</label>
<div class="controls">
<input type="text"/>
</div>
</div>
<div class="fp-author control-group clearfix">
<label class="control-label">'.get_string('author', 'repository').'</label>
<div class="controls">
<input type="text"/>
</div>
</div>
<div class="fp-license control-group clearfix">
<label class="control-label">'.get_string('chooselicense', 'repository').'</label>
<div class="controls">
<select></select>
</div>
</div>
<div class="fp-path control-group clearfix">
<label class="control-label">'.get_string('path', 'repository').'</label>
<div class="controls">
<select></select>
</div>
</div>
<div class="fp-original control-group clearfix">
<label class="control-label">'.get_string('original', 'repository').'</label>
<div class="controls">
<span class="fp-originloading">'.$iconprogress.' '.$strloading.'</span><span class="fp-value"></span>
</div>
</div>
<div class="fp-reflist control-group clearfix">
<label class="control-label">'.get_string('referenceslist', 'repository').'</label>
<div class="controls">
<p class="fp-refcount"></p>
<span class="fp-reflistloading">'.$iconprogress.' '.$strloading.'</span>
<ul class="fp-value"></ul>
</div>
</div>
</div>
<div class="fp-select-buttons">
<button class="{!}fp-file-update">'.get_string('update', 'moodle').'</button>
<button class="{!}fp-file-cancel">'.get_string('cancel').'</button>
<button class="fp-file-update btn-primary">'.get_string('update', 'moodle').'</button>
<button class="fp-file-cancel btn-cancel">'.get_string('cancel').'</button>
</div>
</form>
<div class="fp-info clearfix">
<div class="fp-hr"></div>
<p class="{!}fp-thumbnail"></p>
<p class="fp-thumbnail"></p>
<div class="fp-fileinfo">
<div class="{!}fp-datemodified">'.get_string('lastmodified', 'moodle').': <span class="fp-value"></span></div>
<div class="{!}fp-datecreated">'.get_string('datecreated', 'repository').': <span class="fp-value"></span></div>
<div class="{!}fp-size">'.get_string('size', 'repository').': <span class="fp-value"></span></div>
<div class="{!}fp-dimensions">'.get_string('dimensions', 'repository').': <span class="fp-value"></span></div>
<div class="fp-datemodified">'.get_string('lastmodified', 'repository').' <span class="fp-value"></span></div>
<div class="fp-datecreated">'.get_string('datecreated', 'repository').' <span class="fp-value"></span></div>
<div class="fp-size">'.get_string('size', 'repository').' <span class="fp-value"></span></div>
<div class="fp-dimensions">'.get_string('dimensions', 'repository').' <span class="fp-value"></span></div>
</div>
</div>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -429,11 +469,11 @@ class core_files_renderer extends plugin_renderer_base {
private function fm_js_template_confirmdialog() {
$rv = '
<div class="filemanager fp-dlg">
<div class="{!}fp-dlg-text"></div>
<button class="{!}fp-dlg-butconfirm">'.get_string('ok').'</button>
<button class="{!}fp-dlg-butcancel">'.get_string('cancel').'</button>
<div class="fp-dlg-text"></div>
<button class="fp-dlg-butconfirm btn-primary">'.get_string('ok').'</button>
<button class="fp-dlg-butcancel btn-cancel">'.get_string('cancel').'</button>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -525,36 +565,64 @@ class core_files_renderer extends plugin_renderer_base {
<div tabindex="0" class="file-picker fp-generallayout" role="dialog" aria-live="assertive">
<div class="fp-repo-area">
<ul class="fp-list">
<li class="{!}fp-repo"><a href="#"><img class="{!}fp-repo-icon" alt=" " width="16" height="16" />&nbsp;<span class="{!}fp-repo-name"></span></a></li>
<li class="fp-repo">
<a href="#"><img class="fp-repo-icon" alt=" " width="16" height="16" />&nbsp;<span class="fp-repo-name"></span></a>
</li>
</ul>
</div>
<div class="fp-repo-items" tabindex="0">
<div class="fp-navbar">
<div>
<div class="{!}fp-toolbar">
<div class="{!}fp-tb-back"><a href="#">'.get_string('back', 'repository').'</a></div>
<div class="{!}fp-tb-search"><form></form></div>
<div class="{!}fp-tb-refresh"><a title="'. get_string('refresh', 'repository') .'" href="#"><img alt="" src="'.$this->pix_url('a/refresh').'" /></a></div>
<div class="{!}fp-tb-logout"><a title="'. get_string('logout', 'repository') .'" href="#"><img alt="" src="'.$this->pix_url('a/logout').'" /></a></div>
<div class="{!}fp-tb-manage"><a title="'. get_string('settings', 'repository') .'" href="#"><img alt="" src="'.$this->pix_url('a/setting').'" /></a></div>
<div class="{!}fp-tb-help"><a title="'. get_string('help', 'repository') .'" href="#"><img alt="" src="'.$this->pix_url('a/help').'" /></a></div>
<div class="{!}fp-tb-message"></div>
<div class="fp-toolbar">
<div class="fp-tb-back">
<a href="#">'.get_string('back', 'repository').'</a>
</div>
<div class="fp-tb-search">
<form></form>
</div>
<div class="fp-tb-refresh">
<a title="'. get_string('refresh', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/refresh').'" />
</a>
</div>
<div class="fp-tb-logout">
<a title="'. get_string('logout', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/logout').'" />
</a>
</div>
<div class="fp-tb-manage">
<a title="'. get_string('settings', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/setting').'" />
</a>
</div>
<div class="fp-tb-help">
<a title="'. get_string('help', 'repository') .'" href="#">
<img alt="" src="'.$this->pix_url('a/help').'" />
</a>
</div>
<div class="fp-tb-message"></div>
</div>
<div class="{!}fp-viewbar">
<a title="'. get_string('displayicons', 'repository') .'" class="{!}fp-vb-icons" href="#"><img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" /></a>
<a title="'. get_string('displaydetails', 'repository') .'" class="{!}fp-vb-details" href="#"><img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" /></a>
<a title="'. get_string('displaytree', 'repository') .'" class="{!}fp-vb-tree" href="#"><img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" /></a>
<div class="fp-viewbar">
<a title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#">
<img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" />
</a>
<a title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#">
<img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" />
</a>
<a title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#">
<img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" />
</a>
</div>
<div class="fp-clear-left"></div>
</div>
<div class="fp-pathbar">
<span class="{!}fp-path-folder"><a class="{!}fp-path-folder-name" href="#"></a></span>
<span class="fp-path-folder"><a class="fp-path-folder-name" href="#"></a></span>
</div>
</div>
<div class="{!}fp-content"></div>
<div class="fp-content"></div>
</div>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -578,15 +646,15 @@ class core_files_renderer extends plugin_renderer_base {
$rv = '
<a class="fp-file" href="#" >
<div style="position:relative;">
<div class="{!}fp-thumbnail"></div>
<div class="fp-thumbnail"></div>
<div class="fp-reficons1"></div>
<div class="fp-reficons2"></div>
</div>
<div class="fp-filename-field">
<p class="{!}fp-filename"></p>
<p class="fp-filename"></p>
</div>
</a>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -609,11 +677,11 @@ class core_files_renderer extends plugin_renderer_base {
$rv = '
<span class="fp-filename-icon">
<a href="#">
<span class="{!}fp-icon"></span>
<span class="{!}fp-filename"></span>
<span class="fp-icon"></span>
<span class="fp-filename"></span>
</a>
</span>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -631,13 +699,13 @@ class core_files_renderer extends plugin_renderer_base {
*/
private function fp_js_template_nextpage() {
$rv = '
<div class="{!}fp-nextpage">
<div class="fp-nextpage">
<div class="fp-nextpage-link"><a href="#">'.get_string('more').'</a></div>
<div class="fp-nextpage-loading">
<img src="'.$this->pix_url('i/loading_small').'" />
</div>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -674,46 +742,64 @@ class core_files_renderer extends plugin_renderer_base {
<div class="fp-select-loading">
<img src="'.$this->pix_url('i/loading_small').'" />
</div>
<form>
<table>
<tr class="{!}fp-linktype-2">
<td class="mdl-right"></td>
<td class="mdl-left"><input type="radio"/><label>&nbsp;'.get_string('makefileinternal', 'repository').'</label></td></tr>
<tr class="{!}fp-linktype-1">
<td class="mdl-right"></td>
<td class="mdl-left"><input type="radio"/><label>&nbsp;'.get_string('makefilelink', 'repository').'</label></td></tr>
<tr class="{!}fp-linktype-4">
<td class="mdl-right"></td>
<td class="mdl-left"><input type="radio"/><label>&nbsp;'.get_string('makefilereference', 'repository').'</label></td></tr>
<tr class="{!}fp-saveas">
<td class="mdl-right"><label>'.get_string('saveas', 'repository').'</label>:</td>
<td class="mdl-left"><input type="text"/></td></tr>
<tr class="{!}fp-setauthor">
<td class="mdl-right"><label>'.get_string('author', 'repository').'</label>:</td>
<td class="mdl-left"><input type="text" /></td></tr>
<tr class="{!}fp-setlicense">
<td class="mdl-right"><label>'.get_string('chooselicense', 'repository').'</label>:</td>
<td class="mdl-left"><select></select></td></tr>
</table>
<div class="fp-select-buttons">
<button class="{!}fp-select-confirm">'.get_string('getfile', 'repository').'</button>
<button class="{!}fp-select-cancel">'.get_string('cancel').'</button>
<form class="form-horizontal">
<div class="fp-forminset">
<div class="fp-linktype-2 control-group clearfix">
<label class="control-label">'.get_string('makefileinternal', 'repository').'</label>
<div class="controls">
<input type="radio"/>
</div>
</div>
<div class="fp-linktype-1 control-group clearfix">
<label class="control-label">'.get_string('makefilelink', 'repository').'</label>
<div class="controls">
<input type="radio"/>
</div>
</div>
<div class="fp-linktype-4 control-group clearfix">
<label class="control-label">'.get_string('makefilereference', 'repository').'</label>
<div class="controls">
<input type="radio"/>
</div>
</div>
<div class="fp-saveas control-group clearfix">
<label class="control-label">'.get_string('saveas', 'repository').'</label>
<div class="controls">
<input type="text"/>
</div>
</div>
<div class="fp-setauthor control-group clearfix">
<label class="control-label">'.get_string('author', 'repository').'</label>
<div class="controls">
<input type="text"/>
</div>
</div>
<div class="fp-setlicense control-group clearfix">
<label class="control-label">'.get_string('chooselicense', 'repository').'</label>
<div class="controls">
<select></select>
</div>
</div>
</div>
<div class="fp-select-buttons">
<button class="fp-select-confirm btn-primary">'.get_string('getfile', 'repository').'</button>
<button class="fp-select-cancel btn-cancel">'.get_string('cancel').'</button>
</div>
</form>
<div class="fp-info clearfix">
<div class="fp-hr"></div>
<p class="{!}fp-thumbnail"></p>
<p class="fp-thumbnail"></p>
<div class="fp-fileinfo">
<div class="{!}fp-datemodified">'.get_string('lastmodified', 'moodle').': <span class="fp-value"></span></div>
<div class="{!}fp-datecreated">'.get_string('datecreated', 'repository').': <span class="fp-value"></span></div>
<div class="{!}fp-size">'.get_string('size', 'repository').': <span class="fp-value"></span></div>
<div class="{!}fp-license">'.get_string('license', 'moodle').': <span class="fp-value"></span></div>
<div class="{!}fp-author">'.get_string('author', 'repository').': <span class="fp-value"></span></div>
<div class="{!}fp-dimensions">'.get_string('dimensions', 'repository').': <span class="fp-value"></span></div>
<div class="fp-datemodified">'.get_string('lastmodified', 'moodle').'<span class="fp-value"></span></div>
<div class="fp-datecreated">'.get_string('datecreated', 'repository').'<span class="fp-value"></span></div>
<div class="fp-size">'.get_string('size', 'repository').'<span class="fp-value"></span></div>
<div class="fp-license">'.get_string('license', 'moodle').'<span class="fp-value"></span></div>
<div class="fp-author">'.get_string('author', 'repository').'<span class="fp-value"></span></div>
<div class="fp-dimensions">'.get_string('dimensions', 'repository').'<span class="fp-value"></span></div>
</div>
<div>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -736,28 +822,42 @@ class core_files_renderer extends plugin_renderer_base {
*/
private function fp_js_template_uploadform() {
$rv = '
<div class="fp-upload-form mdl-align">
<div class="fp-upload-form">
<div class="fp-content-center">
<form enctype="multipart/form-data" method="POST">
<table >
<tr class="{!}fp-file">
<td class="mdl-right"><label>'.get_string('attachment', 'repository').'</label>:</td>
<td class="mdl-left"><input type="file"/></td></tr>
<tr class="{!}fp-saveas">
<td class="mdl-right"><label>'.get_string('saveas', 'repository').'</label>:</td>
<td class="mdl-left"><input type="text"/></td></tr>
<tr class="{!}fp-setauthor">
<td class="mdl-right"><label>'.get_string('author', 'repository').'</label>:</td>
<td class="mdl-left"><input type="text"/></td></tr>
<tr class="{!}fp-setlicense">
<td class="mdl-right"><label>'.get_string('chooselicense', 'repository').'</label>:</td>
<td class="mdl-left"><select></select></td></tr>
</table>
<form enctype="multipart/form-data" method="POST" class="form-horizontal">
<div class="fp-formset">
<div class="fp-file control-group clearfix">
<label class="control-label">'.get_string('attachment', 'repository').'</label>
<div class="controls">
<input type="file"/>
</div>
</div>
<div class="fp-saveas control-group clearfix">
<label class="control-label">'.get_string('saveas', 'repository').'</label>
<div class="controls">
<input type="text"/>
</div>
</div>
<div class="fp-setauthor control-group clearfix">
<label class="control-label">'.get_string('author', 'repository').'</label>
<div class="controls">
<input type="text"/>
</div>
</div>
<div class="fp-setlicense control-group clearfix">
<label class="control-label">'.get_string('chooselicense', 'repository').'</label>
<div class="controls">
<select ></select>
</div>
</div>
</div>
</form>
<div><button class="{!}fp-upload-btn">'.get_string('upload', 'repository').'</button></div>
<div class="mdl-align">
<button class="fp-upload-btn btn-primary">'.get_string('upload', 'repository').'</button>
</div>
</div>
</div> ';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -785,8 +885,8 @@ class core_files_renderer extends plugin_renderer_base {
*/
private function fp_js_template_error() {
$rv = '
<div class="fp-content-error" ><div class="{!}fp-error"></div></div>';
return preg_replace('/\{\!\}/', '', $rv);
<div class="fp-content-error" ><div class="fp-error"></div></div>';
return $rv;
}
/**
@ -805,10 +905,10 @@ class core_files_renderer extends plugin_renderer_base {
private function fp_js_template_message() {
$rv = '
<div class="file-picker fp-msg" role="alertdialog" aria-live="assertive" aria-labelledby="fp-msg-labelledby">
<p class="{!}fp-msg-text" id="fp-msg-labelledby"></p>
<button class="{!}fp-msg-butok">'.get_string('ok').'</button>
<p class="fp-msg-text" id="fp-msg-labelledby"></p>
<button class="fp-msg-butok btn-primary">'.get_string('ok').'</button>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -829,14 +929,14 @@ class core_files_renderer extends plugin_renderer_base {
private function fp_js_template_processexistingfile() {
$rv = '
<div class="file-picker fp-dlg">
<p class="{!}fp-dlg-text"></p>
<p class="fp-dlg-text"></p>
<div class="fp-dlg-buttons">
<button class="{!}fp-dlg-butoverwrite">'.get_string('overwrite', 'repository').'</button>
<button class="{!}fp-dlg-butrename"></button>
<button class="{!}fp-dlg-butcancel">'.get_string('cancel').'</button>
<button class="fp-dlg-butoverwrite">'.get_string('overwrite', 'repository').'</button>
<button class="fp-dlg-butrename"></button>
<button class="fp-dlg-butcancel">'.get_string('cancel').'</button>
</div>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -856,15 +956,15 @@ class core_files_renderer extends plugin_renderer_base {
private function fp_js_template_processexistingfilemultiple() {
$rv = '
<div class="file-picker fp-dlg">
<p class="{!}fp-dlg-text"></p>
<a class="{!}fp-dlg-butoverwrite fp-panel-button" href="#">'.get_string('overwrite', 'repository').'</a>
<a class="{!}fp-dlg-butcancel fp-panel-button" href="#">'.get_string('cancel').'</a>
<a class="{!}fp-dlg-butrename fp-panel-button" href="#"></a>
<p class="fp-dlg-text"></p>
<a class="fp-dlg-butoverwrite fp-panel-button" href="#">'.get_string('overwrite', 'repository').'</a>
<a class="fp-dlg-butcancel fp-panel-button" href="#">'.get_string('cancel').'</a>
<a class="fp-dlg-butrename fp-panel-button" href="#"></a>
<br/>
<a class="{!}fp-dlg-butoverwriteall fp-panel-button" href="#">'.get_string('overwriteall', 'repository').'</a>
<a class="{!}fp-dlg-butrenameall fp-panel-button" href="#">'.get_string('renameall', 'repository').'</a>
<a class="fp-dlg-butoverwriteall fp-panel-button" href="#">'.get_string('overwriteall', 'repository').'</a>
<a class="fp-dlg-butrenameall fp-panel-button" href="#">'.get_string('renameall', 'repository').'</a>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**
@ -893,29 +993,35 @@ class core_files_renderer extends plugin_renderer_base {
$rv = '
<div class="fp-login-form">
<div class="fp-content-center">
<form>
<table >
<tr class="{!}fp-login-popup">
<td colspan="2">
<label>'.get_string('popup', 'repository').'</label>
<p class="fp-popup"><button class="{!}fp-login-popup-but">'.get_string('login', 'repository').'</button></p></td></tr>
<tr class="{!}fp-login-textarea">
<td colspan="2"><p><textarea></textarea></p></td></tr>
<tr class="{!}fp-login-select">
<td align="right"><label></label></td>
<td align="left"><select></select></td></tr>
<tr class="{!}fp-login-input">
<td class="label"><label></label></td>
<td class="input"><input/></td></tr>
<tr class="{!}fp-login-radiogroup">
<td align="right" width="30%" valign="top"><label></label></td>
<td align="left" valign="top"><p class="{!}fp-login-radio"><input /> <label></label></p></td></tr>
</table>
<p><button class="{!}fp-login-submit">'.get_string('submit', 'repository').'</button></p>
<form class="form-horizontal">
<div class="fp-formset">
<div class="fp-login-popup control-group clearfix">
<div class="controls fp-popup">
<button class="fp-login-popup-but btn-primary">'.get_string('login', 'repository').'</button>
</div>
</div>
<div class="fp-login-textarea control-group clearfix">
<div class="controls"><textarea></textarea></div>
</div>
<div class="fp-login-select control-group clearfix">
<label class="control-label"></label>
<div class="controls"><select></select></div>
</div>
<div class="fp-login-input control-group clearfix">
<label class="control-label"></label>
<div class="controls"><input/></div>
</div>
<div class="fp-login-radiogroup control-group clearfix">
<label class="control-label"></label>
<div class="controls fp-login-radio"><input /> <label></label></div>
</div>
</div>
<p><button class="fp-login-submit btn-primary">'.get_string('submit', 'repository').'</button></p>
</form>
</div>
</div>';
return preg_replace('/\{\!\}/', '', $rv);
return $rv;
}
/**

View File

@ -45,8 +45,8 @@ $string['areauserbackup'] = 'User backup';
$string['areauserpersonal'] = 'Private files';
$string['areauserprofile'] = 'Profile';
$string['attachedfiles'] = 'Attached files';
$string['attachment'] = 'Attachment';
$string['author'] = 'Author';
$string['attachment'] = 'Attachment:';
$string['author'] = 'Author:';
$string['back'] = '&laquo; Back';
$string['backtodraftfiles'] = '&laquo; Back to draft files manager';
$string['cachecleared'] = 'Cached files are removed';
@ -82,11 +82,11 @@ $string['createinstance'] = 'Create a repository instance';
$string['createrepository'] = 'Create a repository instance';
$string['createxxinstance'] = 'Create "{$a}" instance';
$string['date'] = 'Date';
$string['datecreated'] = 'Created';
$string['datecreated'] = 'Created:';
$string['deleted'] = 'Repository deleted';
$string['deleterepository'] = 'Delete this repository';
$string['detailview'] = 'View details';
$string['dimensions'] = 'Dimensions';
$string['dimensions'] = 'Dimensions:';
$string['disabled'] = 'Disabled';
$string['displaydetails'] = 'Display folder with file details';
$string['displayicons'] = 'Display folder with file icons';
@ -129,7 +129,7 @@ $string['getfiletimeout'] = 'Get file timeout';
$string['hidden'] = 'Hidden';
$string['help'] = 'Help';
$string['choosealink'] = 'Choose a link...';
$string['chooselicense'] = 'Choose license';
$string['chooselicense'] = 'Choose license:';
$string['iconview'] = 'View as icons';
$string['imagesize'] = '{$a->width} x {$a->height} px';
$string['instance'] = 'instance';
@ -145,10 +145,11 @@ $string['invalidrepositoryid'] = 'Invalid repository ID';
$string['invalidparams'] = 'Invalid parameters';
$string['isactive'] = 'Active?';
$string['keyword'] = 'Keyword';
$string['lastmodified'] = 'Last modified:';
$string['linkexternal'] = 'Link external';
$string['listview'] = 'View as list';
$string['loading'] = 'Loading...';
$string['login'] = 'Login';
$string['login'] = 'Login to your account';
$string['logout'] = 'Logout';
$string['lostsource'] = 'Error. Source is missing. {$a}';
$string['makefileinternal'] = 'Make a copy of the file';
@ -158,6 +159,7 @@ $string['manage'] = 'Manage repositories';
$string['manageurl'] = 'Manage';
$string['manageuserrepository'] = 'Manage individual repository';
$string['moving'] = 'Moving';
$string['name'] = 'Name:';
$string['newfolder'] = 'New folder';
$string['newfoldername'] = 'New folder name:';
$string['noenter'] = 'Nothing entered';
@ -177,6 +179,7 @@ $string['operation'] = 'Operation';
$string['on'] = 'Enabled and visible';
$string['overwrite'] = 'Overwrite';
$string['overwriteall'] = 'Overwrite all';
$string['path'] = 'Path:';
$string['personalrepositories'] = 'Available repository instances';
$string['plugin'] = 'Repository plug-ins';
$string['pluginerror'] = 'Errors in repository plugin.';
@ -198,7 +201,7 @@ $string['repositorycourse'] = 'Course repositories';
$string['repositoryicon'] = 'Repository icon';
$string['repositoryerror'] = 'Remote repository returned error: {$a}';
$string['save'] = 'Save';
$string['saveas'] = 'Save as';
$string['saveas'] = 'Save as:';
$string['saved'] = 'Saved';
$string['saving'] = 'Saving';
$string['automatedbackup'] = 'Automated backups';
@ -211,7 +214,7 @@ $string['setupdefaultplugins'] = 'Setting up default repository plugins';
$string['setmainfile'] = 'Set main file';
$string['setmainfile_help'] = 'If there are multiple files in the folder, the main file is the one that appears on the view page. Other files such as images or videos may be embedded in it. In filemanager the main file is indicated with a title in bold.';
$string['siteinstances'] = 'Repositories instances of the site';
$string['size'] = 'Size';
$string['size'] = 'Size:';
$string['submit'] = 'Submit';
$string['sync'] = 'Sync';
$string['syncfiletimeout'] = 'Sync file timeout';

View File

@ -33,7 +33,7 @@ $string['by-nc-sa'] = 'Attribution-NonCommercial-ShareAlike license';
$string['by-nd'] = 'Attribution-NoDerivs license';
$string['by-sa'] = 'Attribution-ShareAlike license';
$string['callbackurl'] = 'Callback URL';
$string['commercialuse'] = 'I want to be able to use the images commercially';
$string['commercialuse'] = 'I want to use the images commercially';
$string['configplugin'] = 'Flickr public configuration';
$string['creativecommonscommercial'] = 'Only creative commons commercial';
$string['emailaddress'] = 'Email address';

View File

@ -397,7 +397,7 @@ class repository_flickr_public extends repository {
$str .= '<input type="hidden" name="repo_id" value="'.$this->id.'" />';
$str .= '<input type="hidden" name="ctx_id" value="'.$this->context->id.'" />';
$str .= '<input type="hidden" name="seekey" value="'.sesskey().'" />';
$str .= '<label>'.get_string('fulltext', 'repository_flickr_public').': </label><br/><input name="s" value="" /><br/>';
$str .= '<label>'.get_string('fulltext', 'repository_flickr_public').'</label><br/><input name="s" value="" /><br/>';
$str .= '<label>'.get_string('tag', 'repository_flickr_public').'</label><br /><input type="text" name="flickr_tag" /><br />';
return $str;
}

View File

@ -423,6 +423,23 @@ a.ygtvspacer:hover {color:transparent;text-decoration:none;}
.dir-rtl .filemanager-container .yui3-skin-sam .yui3-datatable-header {text-align:right;}
.dir-rtl .filemanager .fp-restrictions { text-align: left; }
/*
* Forms for file picker.
*/
.fp-formset {margin:0 auto;width:500px;}
.fp-formset div {text-align:left;}
.fp-formset .controls {text-align:left;}
.fp-formset label {display:block;float:left;width:210px;text-align:right;margin:0 10px 0 0;}
.fp-formset .fp-popup { text-align: center; }
.fp-formset .fp-setlicense select {width:280px;}
.fp-forminset label {display:block;float:left;width:95px;text-align:right;margin:0 10px 0 0;}
.fp-forminset .controls {float:left;}
.dir-rtl .fp-forminset label {display:block;float:right;width:95px;text-align:right;margin:0 0 0 10px;}
.dir-rtl .fp-forminset .controls {float:right;}
.dir-rtl .fp-forminset .fp-select-buttons {float:left;}
.dir-rtl .fp-forminset .fp-setlicense select, .dir-rtl .fp-forminset .fp-license select {width:248px;}
.dir-rtl .fp-formset label {float:right;text-align:left; margin:0 0 0 10px;}
.dir-rtl .fp-formset div {text-align:right;}
/**
* Responsive styles for the filepicker
@ -437,5 +454,7 @@ a.ygtvspacer:hover {color:transparent;text-decoration:none;}
.fp-content .mdl-right {text-align:left;}
.dir-rtl .fp-content .mdl-right {text-align:right;}
.fp-repo-items .fp-navbar {border-top:1px solid rgb(187, 187, 187);}
.fp-formset, .fp-forminset {margin:0 10px;width:auto;}
.fp-formset label, .fp-forminset label {float:none;width:210px;text-align:left;margin:5px 0;}
.dir-rtl .fp-formset label, .dir-rtl .fp-forminset label {text-align:right;float:none;}
}

View File

@ -1196,4 +1196,59 @@ a.ygtvspacer:hover {
left: 0;
}
}
}
}
// Upload form for file picker.
.fp-formset {
max-width: 500px;
padding: 10px;
input[type="file"] {
line-height: inherit;
}
}
.fp-forminset {
max-width: 400px;
padding: 10px;
.control-group {
label.control-label {
width: 105px;
}
.controls {
margin-left: 125px;
}
}
.fp-select-buttons {
float: none;
}
}
.dir-rtl .fp-forminset {
max-width: 400px;
.control-group {
label.control-label {
float: right;
text-align: left;
}
.controls {
margin-left: 0;
margin-right: 125px;
}
}
.fp-select-buttons {
float: left;
}
input[type="text"] {
width: 248px;
}
}
.dir-rtl .filepicker .fp-formset {
label {
float: right;
text-align: left;
}
.controls {
margin-left: 0;
text-align: right;
}
}

View File

@ -99,9 +99,11 @@
}
}
.fp-formset div {
height: auto;
}
}
// login page
@media (min-width: 1200px) {
.loginbox.twocolumns .loginpanel {
margin-left: 0;
@ -537,3 +539,26 @@
text-align: left;
}
}
// File Picker.
@media (max-width: 768px) {
.fp-forminset .control-group .controls {
margin-left: 0;
}
.dir-rtl .fp-formset .control-group {
label.control-label {
text-align: right;
float: none;
}
}
.dir-rtl .fp-forminset .control-group {
label.control-label {
text-align: right;
float: none;
}
.controls {
margin-right: 0;
}
}
}

File diff suppressed because one or more lines are too long