From 77da6d6ca677e783f5e104226a179b5f09ab121d Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 5 Jan 2014 22:25:41 +0000 Subject: added css and html changes for RTL scripts to extension manager --- lib/plugins/extension/all.less | 14 ++++++ lib/plugins/extension/helper/extension.php | 4 +- lib/plugins/extension/helper/list.php | 39 +++++++-------- lib/plugins/extension/lang/en/lang.php | 1 + lib/plugins/extension/style.less | 77 ++++++++++++++++++++++++++++-- 5 files changed, 111 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/plugins/extension/all.less b/lib/plugins/extension/all.less index 8b2533e2e..3d9688e14 100644 --- a/lib/plugins/extension/all.less +++ b/lib/plugins/extension/all.less @@ -20,4 +20,18 @@ } } +[dir=rtl] #extension__list .legend { + > div { + padding-right: 0; + } + + div.screenshot { + margin: 0 0 .5em .5em; + } + + div.linkbar { + clear: right; + } +} + } /* /@media */ diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index d200d5ab0..02c2cc8ad 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -829,7 +829,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { // download if(!$file = io_download($url, $tmp.'/', true, $file, 0)) { $this->dir_delete($tmp); - throw new Exception(sprintf($this->getLang('error_download'), hsc($url))); + throw new Exception(sprintf($this->getLang('error_download'), ''.hsc($url).'')); } return $tmp.'/'.$file; @@ -921,7 +921,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { 'action' => $action ); } else { - throw new Exception(sprintf($this->getLang('error_copy').DOKU_LF, $item['base'])); + throw new Exception(sprintf($this->getLang('error_copy').DOKU_LF, ''.$item['base'].'')); } } diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index f387a6de6..7a08655b7 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -164,10 +164,10 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $mailid = $extension->getEmailID(); if($mailid){ $url = $this->gui->tabURL('search', array('q' => 'authorid:'.$mailid)); - return ' '.hsc($extension->getAuthor()).''; + return ' '.hsc($extension->getAuthor()).''; }else{ - return ''.hsc($extension->getAuthor()).''; + return ''.hsc($extension->getAuthor()).''; } } return "".$this->getLang('unknown_author')."".DOKU_LF; @@ -204,7 +204,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { function make_legend(helper_plugin_extension_extension $extension, $showinfo = false) { $return = '
'; $return .= '

'; - $return .= sprintf($this->getLang('extensionby'), hsc($extension->getDisplayName()), $this->make_author($extension)); + $return .= sprintf($this->getLang('extensionby'), ''.hsc($extension->getDisplayName()).'', $this->make_author($extension)); $return .= '

'.DOKU_LF; $return .= $this->make_screenshot($extension); @@ -215,11 +215,11 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $return .= '
'.$popularityText.'
'.DOKU_LF; } - $return .= '

'; if($extension->getDescription()) { + $return .= '

'; $return .= hsc($extension->getDescription()).' '; + $return .= '

'.DOKU_LF; } - $return .= '

'.DOKU_LF; $return .= $this->make_linkbar($extension); @@ -255,6 +255,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { if($extension->getTags()){ $first = true; $return .= ''; + $return .= ''.$this->getLang('tags').' '; foreach ($extension->getTags() as $tag) { if(!$first){ $return .= ', '; @@ -262,7 +263,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $first = false; } $url = $this->gui->tabURL('search', array('q' => 'tag:'.$tag)); - $return .= ''.hsc($tag).''; + $return .= ''.hsc($tag).''; } $return .= ''; } @@ -281,22 +282,22 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $missing_dependencies = $extension->getMissingDependencies(); if(!empty($missing_dependencies)) { $return .= '
'. - sprintf($this->getLang('missing_dependency'), implode(', ', /*array_map(array($this->helper, 'make_extensionsearchlink'),*/ $missing_dependencies)). + sprintf($this->getLang('missing_dependency'), ''.implode(', ', /*array_map(array($this->helper, 'make_extensionsearchlink'),*/ $missing_dependencies).''). '
'; } if($extension->isInWrongFolder()) { $return .= '
'. - sprintf($this->getLang('wrong_folder'), hsc($extension->getInstallName()), hsc($extension->getBase())). + sprintf($this->getLang('wrong_folder'), ''.hsc($extension->getInstallName()).'', ''.hsc($extension->getBase()).''). '
'; } if(($securityissue = $extension->getSecurityIssue()) !== false) { $return .= '
'. - sprintf($this->getLang('security_issue'), hsc($securityissue )). + sprintf($this->getLang('security_issue'), ''.hsc($securityissue).''). '
'; } if(($securitywarning = $extension->getSecurityWarning()) !== false) { $return .= '
'. - sprintf($this->getLang('security_warning'), hsc($securitywarning)). + sprintf($this->getLang('security_warning'), ''.hsc($securitywarning).''). '
'; } if($extension->updateAvailable()) { @@ -306,7 +307,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { } if($extension->hasDownloadURLChanged()) { $return .= '
'. - sprintf($this->getLang('url_change'), hsc($extension->getDownloadURL()), hsc($extension->getLastDownloadURL())). + sprintf($this->getLang('url_change'), ''.hsc($extension->getDownloadURL()).'', ''.hsc($extension->getLastDownloadURL()).''). '
'; } return $return.DOKU_LF; @@ -354,14 +355,14 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { if (!$extension->isBundled()) { $return .= '
'.$this->getLang('downloadurl').'
'; - $return .= '
'; + $return .= '
'; $return .= ($extension->getDownloadURL() ? $this->shortlink($extension->getDownloadURL()) : $default); - $return .= '
'; + $return .= ''; $return .= '
'.$this->getLang('repository').'
'; - $return .= '
'; + $return .= '
'; $return .= ($extension->getSourcerepoURL() ? $this->shortlink($extension->getSourcerepoURL()) : $default); - $return .= '
'; + $return .= ''; } if ($extension->isInstalled()) { @@ -392,15 +393,15 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { } $return .= '
'.$this->getLang('provides').'
'; - $return .= '
'; + $return .= '
'; $return .= ($extension->getTypes() ? hsc(implode(', ', $extension->getTypes())) : $default); - $return .= '
'; + $return .= ''; if($extension->getCompatibleVersions()) { $return .= '
'.$this->getLang('compatible').'
'; $return .= '
'; foreach ($extension->getCompatibleVersions() as $date => $version) { - $return .= $version['label'].' ('.$date.'), '; + $return .= ''.$version['label'].' ('.$date.'), '; } $return = rtrim($return, ', '); $return .= '
'; @@ -438,7 +439,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { function make_linklist($ext) { $return = ''; foreach ($ext as $link) { - $return .= ''.hsc($link).', '; + $return .= ''.hsc($link).', '; } return rtrim($return, ', '); } diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php index fd00b5007..83ff19f00 100644 --- a/lib/plugins/extension/lang/en/lang.php +++ b/lib/plugins/extension/lang/en/lang.php @@ -39,6 +39,7 @@ $lang['screenshot'] = 'Screenshot of %s'; $lang['popularity'] = 'Popularity: %s%%'; $lang['homepage_link'] = 'Docs'; $lang['bugs_features'] = 'Bugs'; +$lang['tags'] = 'Tags:'; $lang['author_hint'] = 'Search extensions by this author'; $lang['installed'] = 'Installed:'; $lang['downloadurl'] = 'Download URL:'; diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less index a60aac8bf..d20689099 100644 --- a/lib/plugins/extension/style.less +++ b/lib/plugins/extension/style.less @@ -52,7 +52,6 @@ background-color: @ini_background_alt; margin: 0 0 10px 0; padding: 10px 10px 8px; - text-align: left; overflow: hidden; } @@ -120,8 +119,8 @@ min-height: 24px; min-width: 24px; position: absolute; - left: 0px; - top: 0px; + left: 0; + top: 0; } } @@ -220,6 +219,64 @@ } } +[dir=rtl] #extension__list .legend { + float: right; + + > div { + padding: 0 132px 0 .5em; + border-left: 1px solid @ini_background_alt; + border-right-width: 0; + } + + div.screenshot { + margin-left: 0; + margin-right: -132px; + float: right; + + span { + left: auto; + right: 0; + } + } + + h2 { + float: left; + } + + div.popularity { + right: auto; + left: .5em; + } + + div.linkbar span.tags, + dl.details dd a.donate { + padding-left: 0; + padding-right: 18px; + background-position: top right; + } + + a.info { + float: left; + } + + dl.details { + dt { + clear: right; + float: right; + text-align: left; + padding-left: 5px; + padding-right: 0; + } + + dd { + margin-left: 0; + margin-right: 25%; + padding-left: 0; + padding-right: 5px; + } + } +} + /* * Enabled/Disabled overrides */ @@ -266,6 +323,20 @@ } } +[dir=rtl] #extension__manager .actions { + float: left; + text-align: left; + + p.permerror { + margin-left: 0; + margin-right: 0.4em; + text-align: right; + padding-left: 0; + padding-right: 19px; + background-position: center right; + } +} + /** * Search form */ -- cgit v1.2.3