diff options
author | Michael Hamann <michael@content-space.de> | 2013-08-02 23:30:32 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2013-08-02 23:31:51 +0200 |
commit | 02779b18797b2ee1304613de684d54988815dacb (patch) | |
tree | aab9f1a898c0603e875ecc4d0e086bb0b5086bcb /lib/plugins | |
parent | 1981046ea006031f74fb082960756b3d2919b99e (diff) | |
download | rpg-02779b18797b2ee1304613de684d54988815dacb.tar.gz rpg-02779b18797b2ee1304613de684d54988815dacb.tar.bz2 |
Extension manager: Implement extension table
This uses a lot of code and the whole design from the previous extension
manager implementation.
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/extension/admin.php | 78 | ||||
-rw-r--r-- | lib/plugins/extension/helper/extension.php | 189 | ||||
-rw-r--r-- | lib/plugins/extension/helper/list.php | 477 | ||||
-rw-r--r-- | lib/plugins/extension/images/disabled.png | bin | 0 -> 1486 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/donate.png | bin | 0 -> 1293 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/down.png | bin | 0 -> 280 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/enabled.png | bin | 0 -> 1231 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/icons.xcf | bin | 0 -> 43016 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/license.txt | 4 | ||||
-rw-r--r-- | lib/plugins/extension/images/plugin.png | bin | 0 -> 6259 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/template.png | bin | 0 -> 6802 bytes | |||
-rw-r--r-- | lib/plugins/extension/images/up.png | bin | 0 -> 281 bytes | |||
-rw-r--r-- | lib/plugins/extension/lang/en/lang.php | 96 | ||||
-rw-r--r-- | lib/plugins/extension/style.css | 368 |
14 files changed, 1172 insertions, 40 deletions
diff --git a/lib/plugins/extension/admin.php b/lib/plugins/extension/admin.php index 19863e772..373f90183 100644 --- a/lib/plugins/extension/admin.php +++ b/lib/plugins/extension/admin.php @@ -9,7 +9,11 @@ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); +/** + * Admin part of the extension manager + */ class admin_plugin_extension extends DokuWiki_Admin_Plugin { + protected $infoFor = null; /** * @return int sort number in admin menu @@ -26,32 +30,94 @@ class admin_plugin_extension extends DokuWiki_Admin_Plugin { } /** - * Should carry out any processing required by the plugin. + * Execute the requested action(s) and initialize the plugin repository */ public function handle() { + global $INPUT; + // initialize the remote repository /* @var helper_plugin_extension_repository $repository */ $repository = $this->loadHelper('extension_repository'); $repository->init(); + + /* @var helper_plugin_extension_extension $extension */ + $extension = $this->loadHelper('extension_extension'); + + if ($INPUT->post->has('fn')) { + $actions = $INPUT->post->arr('fn'); + foreach ($actions as $action => $extensions) { + foreach ($extensions as $extname => $label) { + switch ($action) { + case 'info': + $this->infoFor = $extname; + break; + case 'install': + msg('Not implemented'); + break; + case 'reinstall': + case 'update': + $extension->setExtension($extname, false); + $status = $extension->installOrUpdate(); + if ($status !== true) { + msg($status, -1); + } else { + msg(sprintf($this->getLang('msg_update_success'), hsc($extension->getName())), 1); + } + break; + case 'uninstall': + $extension->setExtension($extname, false); + $status = $extension->uninstall(); + if ($status !== true) { + msg($status, -1); + } else { + msg(sprintf($this->getLang('msg_delete_success'), hsc($extension->getName())), 1); + } + break; + case 'enable'; + $extension->setExtension($extname, false); + $status = $extension->enable(); + if ($status !== true) { + msg($status, -1); + } else { + msg(sprintf($this->getLang('msg_enabled'), hsc($extension->getName())), 1); + } + break; + case 'disable'; + $extension->setExtension($extname, false); + $status = $extension->disable(); + if ($status !== true) { + msg($status, -1); + } else { + msg(sprintf($this->getLang('msg_disabled'), hsc($extension->getName())), 1); + } + break; + } + } + } + } } /** - * Render HTML output, e.g. helpful text and a form + * Render HTML output */ public function html() { /* @var Doku_Plugin_Controller $plugin_controller */ global $plugin_controller; ptln('<h1>'.$this->getLang('menu').'</h1>'); + ptln('<div id="extension__manager">'); $pluginlist = $plugin_controller->getList('', true); /* @var helper_plugin_extension_extension $extension */ $extension = $this->loadHelper('extension_extension'); + /* @var helper_plugin_extension_list $list */ + $list = $this->loadHelper('extension_list'); + $list->start_form(); foreach ($pluginlist as $name) { $extension->setExtension($name, false); - ptln('<h2>'.hsc($extension->getName()).'</h2>'); - ptln('<p>'.hsc($extension->getDescription()).'</p>'); - ptln('<p>Latest available version: '.hsc($extension->getLastUpdate()).'</p>'); - ptln('<p>Installed version: '.hsc($extension->getInstalledVersion()).'</p>'); + $list->add_row($extension, $name == $this->infoFor); } + $list->end_form(); + $list->render(); + ptln('</div>'); } } diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index b80e56a4d..093ee7828 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -65,6 +65,35 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { } /** + * If the extension is bundled + * + * @return bool If the extension is bundled + */ + public function isBundled() { + if (!empty($this->remoteInfo['bundled'])) return $this->remoteInfo['bundled']; + return in_array($this->name, + array('acl', 'info', 'extension', 'test', 'revert', 'popularity', 'config', 'plugin', 'safefnrecode', 'authplain')); + } + + /** + * If the extension is protected + * + * @return bool if the extension is protected + */ + public function isProtected() { + return in_array($this->name, array('acl', 'config', 'info', 'plugin', 'revert', 'usermanager')); + } + + /** + * If the extension is installed in the correct directory + * + * @return bool If the extension is installed in the correct directory + */ + public function isInWrongFolder() { + return $this->name != $this->getBase(); + } + + /** * If the extension is enabled * * @return bool If the extension is enabled @@ -97,6 +126,15 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { return $this->is_template; } + /** + * Get the name of the installation directory + * + * @return string The name of the installation directory + */ + public function getInstallName() { + return $this->name; + } + // Data from plugin.info.txt/template.info.txt or the repo when not available locally /** * Get the basename of the extension @@ -104,6 +142,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string The basename */ public function getBase() { + if (!empty($this->localInfo['base'])) return $this->localInfo['base']; return $this->name; } @@ -113,20 +152,20 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string The display name */ public function getName() { - if (isset($this->localInfo['name'])) return $this->localInfo['name']; - if (isset($this->remoteInfo['name'])) return $this->remoteInfo['name']; + if (!empty($this->localInfo['name'])) return $this->localInfo['name']; + if (!empty($this->remoteInfo['name'])) return $this->remoteInfo['name']; return $this->name; } /** * Get the author name of the extension * - * @return string The name of the author + * @return string|bool The name of the author or false if there is none */ public function getAuthor() { - if (isset($this->localInfo['author'])) return $this->localInfo['author']; - if (isset($this->remoteInfo['author'])) return $this->remoteInfo['author']; - return $this->getLang('unknownauthor'); + if (!empty($this->localInfo['author'])) return $this->localInfo['author']; + if (!empty($this->remoteInfo['author'])) return $this->remoteInfo['author']; + return false; } /** @@ -136,7 +175,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { */ public function getEmail() { // email is only in the local data - if (isset($this->localInfo['email'])) return $this->localInfo['email']; + if (!empty($this->localInfo['email'])) return $this->localInfo['email']; return false; } @@ -146,8 +185,8 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The md5sum of the email if there is any, false otherwise */ public function getEmailID() { - if (isset($this->remoteInfo['emailid'])) return $this->remoteInfo['emailid']; - if (isset($this->localInfo['email'])) return md5($this->localInfo['email']); + if (!empty($this->remoteInfo['emailid'])) return $this->remoteInfo['emailid']; + if (!empty($this->localInfo['email'])) return md5($this->localInfo['email']); return false; } @@ -157,8 +196,8 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string The description */ public function getDescription() { - if (isset($this->localInfo['desc'])) return $this->localInfo['desc']; - if (isset($this->remoteInfo['description'])) return $this->remoteInfo['description']; + if (!empty($this->localInfo['desc'])) return $this->localInfo['desc']; + if (!empty($this->remoteInfo['description'])) return $this->remoteInfo['description']; return ''; } @@ -168,8 +207,8 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string The URL */ public function getURL() { - if (isset($this->localInfo['url'])) return $this->localInfo['url']; - return 'https://www.dokuwiki.org/plugin:'.$this->name; + if (!empty($this->localInfo['url'])) return $this->localInfo['url']; + return 'https://www.dokuwiki.org/'.($this->isTemplate() ? 'template' : 'plugin').':'.$this->getBase(); } /** @@ -178,28 +217,66 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The version, usually in the form yyyy-mm-dd if there is any */ public function getInstalledVersion() { - if (isset($this->localInfo['date'])) return $this->localInfo['date']; + if (!empty($this->localInfo['date'])) return $this->localInfo['date']; if ($this->isInstalled()) return $this->getLang('unknownversion'); return false; } /** + * Get the install date of the current version + * + * @return string|bool The date of the last update or false if not available + */ + public function getUpdateDate() { + if (!empty($this->managerData['updated'])) return $this->managerData['updated']; + return false; + } + + /** + * Get the date of the installation of the plugin + * + * @return string|bool The date of the installation or false if not available + */ + public function getInstallDate() { + if (!empty($this->managerData['installed'])) return $this->managerData['installed']; + return false; + } + + /** * Get the names of the dependencies of this extension * * @return array The base names of the dependencies */ public function getDependencies() { - if (isset($this->remoteInfo['dependencies'])) return $this->remoteInfo['dependencies']; + if (!empty($this->remoteInfo['dependencies'])) return $this->remoteInfo['dependencies']; return array(); } /** + * Get the names of the missing dependencies + * + * @return array The base names of the missing dependencies + */ + public function getMissingDependencies() { + /* @var Doku_Plugin_Controller $plugin_controller */ + global $plugin_controller; + $dependencies = $this->getDependencies(); + $missing_dependencies = array(); + foreach ($dependencies as $dependency) { + if ($plugin_controller->isdisabled($dependency)) { + $missing_dependencies[] = $dependency; + } + } + return $missing_dependencies; + } + + /** * Get the names of all conflicting extensions * * @return array The names of the conflicting extensions */ public function getConflicts() { - if (isset($this->remoteInfo['conflicts'])) return $this->remoteInfo['dependencies']; + if (!empty($this->remoteInfo['conflicts'])) return $this->remoteInfo['dependencies']; return array(); } @@ -209,7 +286,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return array The names of similar extensions */ public function getSimilarExtensions() { - if (isset($this->remoteInfo['similar'])) return $this->remoteInfo['similar']; + if (!empty($this->remoteInfo['similar'])) return $this->remoteInfo['similar']; return array(); } @@ -219,17 +296,28 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return array The names of the tags of the extension */ public function getTags() { - if (isset($this->remoteInfo['tags'])) return $this->remoteInfo['tags']; + if (!empty($this->remoteInfo['tags'])) return $this->remoteInfo['tags']; return array(); } /** + * Get the popularity information as floating point number [0,1] + * + * @return float|bool The popularity information or false if it isn't available + */ + public function getPopularity() { + if (!empty($this->remoteInfo['popularity'])) return $this->remoteInfo['popularity']/200.0; + return false; + } + + + /** * Get the text of the security warning if there is any * * @return string|bool The security warning if there is any, false otherwise */ public function getSecurityWarning() { - if (isset($this->remoteInfo['securitywarning'])) return $this->remoteInfo['securitywarning']; + if (!empty($this->remoteInfo['securitywarning'])) return $this->remoteInfo['securitywarning']; return false; } @@ -239,7 +327,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The security issue if there is any, false otherwise */ public function getSecurityIssue() { - if (isset($this->remoteInfo['securityissue'])) return $this->remoteInfo['securityissue']; + if (!empty($this->remoteInfo['securityissue'])) return $this->remoteInfo['securityissue']; return false; } @@ -249,17 +337,26 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The screenshot URL if there is any, false otherwise */ public function getScreenshotURL() { - if (isset($this->remoteInfo['screenshoturl'])) return $this->remoteInfo['screenshoturl']; + if (!empty($this->remoteInfo['screenshoturl'])) return $this->remoteInfo['screenshoturl']; return false; } /** + * Get the URL of the thumbnail of the extension if there is any + * + * @return string|bool The thumbnail URL if there is any, false otherwise + */ + public function getThumbnailURL() { + if (!empty($this->remoteInfo['thumbnailurl'])) return $this->remoteInfo['thumbnailurl']; + return false; + } + /** * Get the last used download URL of the extension if there is any * * @return string|bool The previously used download URL, false if the extension has been installed manually */ public function getLastDownloadURL() { - if (isset($this->managerData['downloadurl'])) return $this->managerData['downloadurl']; + if (!empty($this->managerData['downloadurl'])) return $this->managerData['downloadurl']; return false; } @@ -269,17 +366,28 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The download URL if there is any, false otherwise */ public function getDownloadURL() { - if (isset($this->remoteInfo['downloadurl'])) return $this->remoteInfo['downloadurl']; + if (!empty($this->remoteInfo['downloadurl'])) return $this->remoteInfo['downloadurl']; return false; } /** + * If the download URL has changed since the last download + * + * @return bool If the download URL has changed + */ + public function hasDownloadURLChanged() { + $lasturl = $this->getLastDownloadURL(); + $currenturl = $this->getDownloadURL(); + return ($lasturl && $currenturl && $lasturl != $currenturl); + } + + /** * Get the bug tracker URL of the extension if there is any * * @return string|bool The bug tracker URL if there is any, false otherwise */ public function getBugtrackerURL() { - if (isset($this->remoteInfo['bugtracker'])) return $this->remoteInfo['bugtracker']; + if (!empty($this->remoteInfo['bugtracker'])) return $this->remoteInfo['bugtracker']; return false; } @@ -289,7 +397,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The URL of the source repository if there is any, false otherwise */ public function getSourcerepoURL() { - if (isset($this->remoteInfo['sourcerepo'])) return $this->remoteInfo['sourcerepo']; + if (!empty($this->remoteInfo['sourcerepo'])) return $this->remoteInfo['sourcerepo']; return false; } @@ -299,7 +407,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The donation URL if there is any, false otherwise */ public function getDonationURL() { - if (isset($this->remoteInfo['donationurl'])) return $this->remoteInfo['donationurl']; + if (!empty($this->remoteInfo['donationurl'])) return $this->remoteInfo['donationurl']; return false; } @@ -309,7 +417,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return array The type(s) as array of strings */ public function getTypes() { - if (isset($this->remoteInfo['types'])) return explode(', ', $this->remoteInfo['types']); + if (!empty($this->remoteInfo['types'])) return $this->remoteInfo['types']; if ($this->isTemplate()) return array(32 => 'template'); return array(); } @@ -320,7 +428,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return array The versions in the form yyyy-mm-dd => ('label' => label, 'implicit' => implicit) */ public function getCompatibleVersions() { - if (isset($this->remoteInfo['compatible'])) return $this->remoteInfo['compatible']; + if (!empty($this->remoteInfo['compatible'])) return $this->remoteInfo['compatible']; return array(); } @@ -330,7 +438,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return string|bool The last available update in the form yyyy-mm-dd if there is any, false otherwise */ public function getLastUpdate() { - if (isset($this->remoteInfo['lastupdate'])) return $this->remoteInfo['lastupdate']; + if (!empty($this->remoteInfo['lastupdate'])) return $this->remoteInfo['lastupdate']; return false; } @@ -392,6 +500,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { $status = 'Error, the requested extension hasn\'t been installed or updated'; } $this->setExtension($this->name, $this->isTemplate()); + $this->purgeCache(); } $this->dir_delete(dirname($path)); } @@ -404,6 +513,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return bool If the plugin was sucessfully installed */ public function uninstall() { + $this->purgeCache(); return $this->dir_delete($this->getInstallDir()); } @@ -417,8 +527,9 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { /* @var Doku_Plugin_Controller $plugin_controller */ global $plugin_controller; if (!$this->isInstalled()) return $this->getLang('notinstalled'); - if (!$this->isEnabled()) return $this->getLang('alreadyenabled'); + if ($this->isEnabled()) return $this->getLang('alreadyenabled'); if ($plugin_controller->enable($this->name)) { + $this->purgeCache(); return true; } else { return $this->getLang('pluginlistsaveerror'); @@ -438,6 +549,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { if (!$this->isInstalled()) return $this->getLang('notinstalled'); if (!$this->isEnabled()) return $this->getLang('alreadydisabled'); if ($plugin_controller->disable($this->name)) { + $this->purgeCache(); return true; } else { return $this->getLang('pluginlistsaveerror'); @@ -445,6 +557,17 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { } /** + * Purge the cache by touching the main configuration file + */ + protected function purgeCache() { + global $config_cascade; + + // expire dokuwiki caches + // touching local.php expires wiki page, JS and CSS caches + @touch(reset($config_cascade['main']['local'])); + } + + /** * Read local extension data either from info.txt or getInfo() */ protected function readLocalData() { @@ -463,7 +586,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { foreach($plugin_types as $type) { if(@file_exists($path.$type.'.php')) { - $plugin = plugin_load($type, $this->getBase()); + $plugin = plugin_load($type, $this->name); if ($plugin) break; } @@ -471,7 +594,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { while(false !== ($cp = readdir($dh))) { if($cp == '.' || $cp == '..' || strtolower(substr($cp, -4)) != '.php') continue; - $plugin = plugin_load($type, $this->getBase().'_'.substr($cp, 0, -4)); + $plugin = plugin_load($type, $this->name.'_'.substr($cp, 0, -4)); if ($plugin) break; } if ($plugin) break; @@ -551,7 +674,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { public function download($url, &$path) { // check the url $matches = array(); - if(!preg_match("/[^/]*$/", $url, $matches) || !$matches[0]) { + if(!preg_match("/[^\/]*$/", $url, $matches) || !$matches[0]) { return $this->getLang('baddownloadurl'); } $file = $matches[0]; diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php new file mode 100644 index 000000000..ffb88114d --- /dev/null +++ b/lib/plugins/extension/helper/list.php @@ -0,0 +1,477 @@ +<?php +/** + * DokuWiki Plugin extension (Helper Component) + * + * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html + * @author Michael Hamann <michael@content-space.de> + */ + +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +/** + * Class helper_plugin_extension_extension represents a single extension (plugin or template) + */ +class helper_plugin_extension_list extends DokuWiki_Plugin { + protected $form = ''; + + function start_form() { + $this->form .= '<form id="extension__list" accept-charset="utf-8" method="post" action="">'; + $hidden = array( + 'do'=>'admin', + 'page'=>'extension', + 'sectok'=>getSecurityToken() + ); + $this->add_hidden($hidden); + $this->form .= '<ul class="extensionList">'; + } + /** + * Build single row of extension table + * @param helper_plugin_extension_extension $extension The extension that shall be added + * @param bool $showinfo Show the info area + */ + function add_row(helper_plugin_extension_extension $extension, $showinfo = false) { + $this->start_row($extension); + $this->populate_column('legend', $this->make_legend($extension, $showinfo)); + $this->populate_column('actions', $this->make_actions($extension)); + $this->end_row(); + } + + /** + * Adds a header to the form + * + * @param string $id The id of the header + * @param string $header The content of the header + * @param int $level The level of the header + */ + function add_header($id, $header, $level = 2) { + $this->form .='<h'.$level.' id="'.$id.'">'.hsc($header).'</h'.$level.'>'; + } + + /** + * Adds a paragraph to the form + * + * @param string $data The content + */ + function add_p($data) { + $this->form .= '<p>'.hsc($data).'</p>'; + } + + /** + * Add hidden fields to the form with the given data + * @param array $array + */ + function add_hidden(array $array) { + $this->form .= '<div class="no">'; + foreach ($array as $key => $value) { + $this->form .= '<input type="hidden" name="'.hsc($key).'" value="'.hsc($value).'" />'; + } + $this->form .= '</div>'; + } + + /** + * Add closing tags + */ + function end_form() { + $this->form .= '</ul>'; + $this->form .= '</form>'; + } + + /** + * Print the form + */ + function render() { + echo $this->form; + } + + /** + * Start the HTML for the row for the extension + * + * @param helper_plugin_extension_extension $extension The extension + */ + private function start_row(helper_plugin_extension_extension $extension) { + $this->form .= '<li id="extensionplugin__'.hsc($extension->getInstallName()).'" class="'.$this->make_class($extension).'">'; + } + + /** + * Add a column with the given class and content + * @param string $class The class name + * @param string $html The content + */ + private function populate_column($class, $html) { + $this->form .= '<div class="'.$class.' col">'.$html.'</div>'; + } + + /** + * End the row + */ + private function end_row() { + $this->form .= '</li>'.DOKU_LF; + } + + /** + * Generate the link to the plugin homepage + * + * @param helper_plugin_extension_extension $extension The extension + * @return string The HTML code + */ + function make_homepagelink(helper_plugin_extension_extension $extension) { + $text = $this->getLang('homepage_link'); + $url = hsc($extension->getURL()); + return '<a href="'.$url.'" title="'.$url.'" class ="urlextern">'.$text.'</a> '; + } + + /** + * Generate the class name for the row of the extensio + * + * @param helper_plugin_extension_extension $extension The extension object + * @return string The class name + */ + function make_class(helper_plugin_extension_extension $extension) { + $class = ($extension->isTemplate()) ? 'template' : 'plugin'; + if($extension->isInstalled()) { + $class.=' installed'; + $class.= ($extension->isEnabled()) ? ' enabled':' disabled'; + } + if(!$extension->canModify()) $class.= ' notselect'; + if($extension->isProtected()) $class.= ' protected'; + //if($this->showinfo) $class.= ' showinfo'; + return $class; + } + + /** + * Generate a link to the author of the extension + * + * @param helper_plugin_extension_extension $extension The extension object + * @return string The HTML code of the link + */ + function make_author(helper_plugin_extension_extension $extension) { + global $ID; + + if($extension->getAuthor()) { + + $params = array( + 'do'=>'admin', + 'page'=>'extension', + 'tab'=>'search', + 'q'=>'author:'.$extension->getAuthor() + ); + $url = wl($ID, $params); + return '<a href="'.$url.'" title="'.$this->getLang('author_hint').'" >'.hsc($extension->getAuthor()).'</a>'; + } + return "<em>".$this->getLang('unknown_author')."</em>"; + } + + /** + * Get the link and image tag for the screenshot/thumbnail + * + * @param helper_plugin_extension_extension $extension The extension object + * @return string The HTML code + */ + function make_screenshot(helper_plugin_extension_extension $extension) { + if($extension->getScreenshotURL()) { + $img = '<a title="'.hsc($extension->getName()).'" href="'.hsc($extension->getScreenshotURL()).'" target="_blank">'. + '<img alt="'.hsc($extension->getName()).'" width="120" height="70" src="'.hsc($extension->getThumbnailURL()).'" />'. + '</a>'; + } elseif($extension->isTemplate()) { + $img = '<img alt="template" width="120" height="70" src="'.DOKU_BASE.'lib/plugins/extension/images/template.png" />'; + + } else { + $img = '<img alt="plugin" width="120" height="70" src="'.DOKU_BASE.'lib/plugins/extension/images/plugin.png" />'; + } + return '<div class="screenshot" >'.$img.'<span></span></div>'; + } + + /** + * Extension main description + * + * @param helper_plugin_extension_extension $extension The extension object + * @param bool $showinfo Show the info section + * @return string The HTML code + */ + function make_legend(helper_plugin_extension_extension $extension, $showinfo = false) { + $return = '<div>'; + $return .= '<h2>'; + $return .= sprintf($this->getLang('extensionby'), hsc($extension->getName()), $this->make_author($extension)); + $return .= '</h2>'; + + $return .= $this->make_screenshot($extension); + + $popularity = $extension->getPopularity(); + if ($popularity !== false && !$extension->isBundled()) { + $popularityText = sprintf($this->getLang('popularity'), $popularity); + $return .= '<div class="popularity" title="'.$popularityText.'"><div style="width: '.($popularity * 100).'%;"><span></span></div></div>'; + } + + $return .= '<p>'; + if($extension->getDescription()) { + $return .= hsc($extension->getDescription()).' '; + } + $return .= '</p>'; + + $return .= $this->make_linkbar($extension); + $return .= $this->make_action('info', $extension, $showinfo); + if ($showinfo) { + $return .= $this->make_info($extension); + } + $return .= $this->make_noticearea($extension); + $return .= '</div>'; + return $return; + } + + /** + * Generate the link bar HTML code + * + * @param helper_plugin_extension_extension $extension The extension instance + * @return string The HTML code + */ + function make_linkbar(helper_plugin_extension_extension $extension) { + $return = '<span class="linkbar">'; + $return .= $this->make_homepagelink($extension); + if ($extension->getBugtrackerURL()) { + $return .= ' <a href="'.hsc($extension->getBugtrackerURL()).'" title="'.hsc($extension->getBugtrackerURL()).'" class ="interwiki iw_dokubug">'.$this->getLang('bugs_features').'</a> '; + } + foreach ($extension->getTags() as $tag) { + $return .= hsc($tag).' '; //$this->manager->handler->html_taglink($tag); + } + $return .= '</span>'; + return $return; + } + + /** + * Notice area + * + * @param helper_plugin_extension_extension $extension The extension + * @return string The HTML code + */ + function make_noticearea(helper_plugin_extension_extension $extension) { + $return = ''; + $missing_dependencies = $extension->getMissingDependencies(); + if(!empty($missing_dependencies)) { + $return .= '<div class="msg error">'. + sprintf($this->getLang('missing_dependency'), implode(', ', /*array_map(array($this->helper, 'make_extensionsearchlink'),*/ $missing_dependencies)). + '</div>'; + } + if($extension->isInWrongFolder()) { + $return .= '<div class="msg error">'. + sprintf($this->getLang('wrong_folder'), hsc($extension->getInstallName()), hsc($extension->getBase())). + '</div>'; + } + if(($securityissue = $extension->getSecurityIssue()) !== false) { + $return .= '<div class="msg error">'. + sprintf($this->getLang('security_issue'), hsc($securityissue )). + '</div>'; + } + if(($securitywarning = $extension->getSecurityWarning()) !== false) { + $return .= '<div class="msg notify">'. + sprintf($this->getLang('security_warning'), hsc($securitywarning)). + '</div>'; + } + if($extension->updateAvailable()) { + $return .= '<div class="msg notify">'. + sprintf($this->getLang('update_available'), hsc($extension->getLastUpdate())). + '</div>'; + } + if($extension->hasDownloadURLChanged()) { + $return .= '<div class="msg notify">'. + sprintf($this->getLang('url_change'), hsc($extension->getDownloadURL()), hsc($extension->getLastDownloadURL())). + '</div>'; + } + return $return; + } + + /** + * Create a link from the given URL + * + * Shortens the URL for display + * + * @param string $url + * + * @return string HTML link + */ + function shortlink($url){ + $link = parse_url($url); + + $base = $link['host']; + if($link['port']) $base .= $base.':'.$link['port']; + $long = $link['path']; + if($link['query']) $long .= $link['query']; + + $name = shorten($base, $long, 55); + + return '<a href="'.hsc($url).'" class="urlextern">'.hsc($name).'</a>'; + } + + /** + * Plugin/template details + * + * @param helper_plugin_extension_extension $extension The extension + * @return string The HTML code + */ + function make_info(helper_plugin_extension_extension $extension) { + $default = $this->getLang('unknown'); + $return = '<dl class="details">'; + + if (!$extension->isBundled()) { + $return .= '<dt>'.$this->getLang('downloadurl').'</dt>'; + $return .= '<dd>'; + $return .= ($extension->getDownloadURL() ? $this->shortlink($extension->getDownloadURL()) : $default); + $return .= '</dd>'; + + $return .= '<dt>'.$this->getLang('repository').'</dt>'; + $return .= '<dd>'; + $return .= ($extension->getSourcerepoURL() ? $this->shortlink($extension->getSourcerepoURL()) : $default); + $return .= '</dd>'; + } + + if ($extension->isInstalled()) { + if ($extension->getInstalledVersion()) { + $return .= '<dt>'.$this->getLang('installed_version').'</dt>'; + $return .= '<dd>'; + $return .= hsc($extension->getInstalledVersion()); + $return .= '</dd>'; + } else { + $return .= '<dt>'.$this->getLang('install_date').'</dt>'; + $return .= '<dd>'; + $return .= ($extension->getUpdateDate() ? hsc($extension->getUpdateDate()) : $this->getLang('unknown')); + $return .= '</dd>'; + } + } + if (!$extension->isInstalled() || $extension->updateAvailable()) { + $return .= '<dt>'.$this->getLang('available_version').'</dt>'; + $return .= '<dd>'; + $return .= ($extension->getLastUpdate() ? hsc($extension->getLastUpdate()) : $this->getLang('unknown')); + $return .= '</dd>'; + } + + if($extension->getInstallDate()) { + $return .= '<dt>'.$this->getLang('installed').'</dt>'; + $return .= '<dd>'; + $return .= hsc($extension->getInstallDate()); + $return .= '</dd>'; + } + + $return .= '<dt>'.$this->getLang('provides').'</dt>'; + $return .= '<dd>'; + $return .= ($extension->getTypes() ? hsc(implode(', ', $extension->getTypes())) : $default); + $return .= '</dd>'; + + if($extension->getCompatibleVersions()) { + $return .= '<dt>'.$this->getLang('compatible').'</dt>'; + $return .= '<dd>'; + foreach ($extension->getCompatibleVersions() as $date => $version) { + $return .= $version['label'].' ('.$date.'), '; + } + $return .= '</dd>'; + } + if($extension->getDependencies()) { + $return .= '<dt>'.$this->getLang('depends').'</dt>'; + $return .= '<dd>'; + $return .= $this->make_linklist($extension->getDependencies()); + $return .= '</dd>'; + } + + if($extension->getSimilarExtensions()) { + $return .= '<dt>'.$this->getLang('similar').'</dt>'; + $return .= '<dd>'; + $return .= $this->make_linklist($extension->getSimilarExtensions()); + $return .= '</dd>'; + } + + if($extension->getConflicts()) { + $return .= '<dt>'.$this->getLang('conflicts').'</dt>'; + $return .= '<dd>'; + $return .= $this->make_linklist($extension->getConflicts()); + $return .= '</dd>'; + } + if ($extension->getDonationURL()) { + $return .= '<a href="'.hsc($extension->getDonationURL()).'" class="donate" title="'.$this->getLang('donate').'"></a>'; + } + $return .= '</dl>'; + return $return; + } + + /** + * Generate a list of links for extensions + * @param array $links The links + * @return string The HTML code + */ + function make_linklist($links) { + $return = ''; + foreach ($links as $link) { + $dokulink = hsc($link); + if (strpos($link, 'template:') !== 0) $dokulink = 'plugin:'.$dokulink; + $return .= '<a href="http://www.dokuwiki.org/'.$dokulink.'" title="'.$dokulink.'" class="interwiki iw_doku">'.$link.'</a> '; + } + return $return; + } + + /** + * Display the action buttons if they are possible + * + * @param helper_plugin_extension_extension $extension The extension + * @return string The HTML code + */ + function make_actions(helper_plugin_extension_extension $extension) { + $return = ''; + if (!$extension->isInstalled() && $extension->canModify() === true) { + $return .= $this->make_action('install', $extension); + } elseif ($extension->canModify()) { + if (!$extension->isBundled()) { + $return .= $this->make_action('uninstall', $extension); + if ($extension->getDownloadURL()) { + if ($extension->updateAvailable()) { + $return .= $this->make_action('update', $extension); + } else { + $return .= $this->make_action('reinstall', $extension); + } + } + } + if (!$extension->isProtected()) { + if ($extension->isEnabled()) { + $return .= $this->make_action('disable', $extension); + } else { + $return .= $this->make_action('enable', $extension); + } + } + } + + if (!$extension->isInstalled()) { + $return .= ' <span class="version">'.$this->getLang('available_version').' '; + $return .= ($extension->getLastUpdate() ? hsc($extension->getLastUpdate()) : $this->getLang('unknown')).'</span>'; + } + + return $return; + } + + /** + * Display an action button for an extension + * + * @param string $action The action + * @param helper_plugin_extension_extension $extension The extension + * @param bool $showinfo If the info block is shown + * @return string The HTML code + */ + function make_action($action, $extension, $showinfo = false) { + $title = $revertAction = $extraClass = ''; + + switch ($action) { + case 'info': + $title = 'title="'.$this->getLang('btn_info').'"'; + if ($showinfo) { + $revertAction = '-'; + $extraClass = 'close'; + } + break; + case 'install': + case 'reinstall': + $title = 'title="'.$extension->getDownloadURL().'"'; + break; + } + + $classes = 'button '.$action.' '.$extraClass; + $name = 'fn['.$action.']['.$revertAction.hsc($extension->getInstallName()).']'; + + return '<input class="'.$classes.'" name="'.$name.'" type="submit" value="'.$this->getLang('btn_'.$action).'" '.$title.' />'; + } +} diff --git a/lib/plugins/extension/images/disabled.png b/lib/plugins/extension/images/disabled.png Binary files differnew file mode 100644 index 000000000..7a0dbb3b5 --- /dev/null +++ b/lib/plugins/extension/images/disabled.png diff --git a/lib/plugins/extension/images/donate.png b/lib/plugins/extension/images/donate.png Binary files differnew file mode 100644 index 000000000..b26ceb66e --- /dev/null +++ b/lib/plugins/extension/images/donate.png diff --git a/lib/plugins/extension/images/down.png b/lib/plugins/extension/images/down.png Binary files differnew file mode 100644 index 000000000..df7beda4e --- /dev/null +++ b/lib/plugins/extension/images/down.png diff --git a/lib/plugins/extension/images/enabled.png b/lib/plugins/extension/images/enabled.png Binary files differnew file mode 100644 index 000000000..7c051cda1 --- /dev/null +++ b/lib/plugins/extension/images/enabled.png diff --git a/lib/plugins/extension/images/icons.xcf b/lib/plugins/extension/images/icons.xcf Binary files differnew file mode 100644 index 000000000..a99747d81 --- /dev/null +++ b/lib/plugins/extension/images/icons.xcf diff --git a/lib/plugins/extension/images/license.txt b/lib/plugins/extension/images/license.txt new file mode 100644 index 000000000..254b9cdf6 --- /dev/null +++ b/lib/plugins/extension/images/license.txt @@ -0,0 +1,4 @@ +enabled.png - CC-BY-ND, (c) Emey87 http://www.iconfinder.com/icondetails/65590/48/lightbulb_icon +disabled.png - CC-BY-ND, (c) Emey87 http://www.iconfinder.com/icondetails/65589/48/idea_lightbulb_off_icon +plugin.png - public domain, (c) nicubunu, http://openclipart.org/detail/15093/blue-jigsaw-piece-07-by-nicubunu +template.png - public domain, (c) mathec, http://openclipart.org/detail/166596/palette-by-mathec diff --git a/lib/plugins/extension/images/plugin.png b/lib/plugins/extension/images/plugin.png Binary files differnew file mode 100644 index 000000000..b9133681f --- /dev/null +++ b/lib/plugins/extension/images/plugin.png diff --git a/lib/plugins/extension/images/template.png b/lib/plugins/extension/images/template.png Binary files differnew file mode 100644 index 000000000..383c4d0a3 --- /dev/null +++ b/lib/plugins/extension/images/template.png diff --git a/lib/plugins/extension/images/up.png b/lib/plugins/extension/images/up.png Binary files differnew file mode 100644 index 000000000..ec9337715 --- /dev/null +++ b/lib/plugins/extension/images/up.png diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php index f0999ff01..b3a451ecc 100644 --- a/lib/plugins/extension/lang/en/lang.php +++ b/lib/plugins/extension/lang/en/lang.php @@ -3,6 +3,7 @@ * English language file for extension plugin * * @author Michael Hamann <michael@content-space.de> + * @author Christopher Smith <chris@jalakai.co.uk> */ // menu entry for admin plugins @@ -16,6 +17,100 @@ $lang['pluginlistsaveerror'] = 'There was an error saving the plugin list'; $lang['unknownauthor'] = 'Unknown author'; $lang['unknownversion'] = 'Unknown version'; +// extension list +$lang['btn_info'] = 'Show more info'; +$lang['btn_update'] = 'Update'; +$lang['btn_uninstall'] = 'Uninstall'; +$lang['btn_enable'] = 'Enable'; +$lang['btn_disable'] = 'Disable'; +//$lang['btn_disable_all'] = 'Disable all'; +//$lang['btn_settings'] = 'Settings'; +$lang['btn_install'] = 'Install'; +$lang['btn_reinstall'] = 'Re-install'; +//$lang['btn_disdown'] = 'Download as Disabled'; +//$lang['btn_dependown'] = 'Download with dependencies'; + +$lang['extensionby'] = '<strong>%s</strong> by %s'; +$lang['popularity'] = 'Popularity: %s'; +$lang['homepage_link'] = 'Docs'; +$lang['bugs_features'] = 'Bugs'; +$lang['author_hint'] = 'Search extensions by this author'; +$lang['tag_hint'] = 'Search extensions with this tag'; +$lang['installed'] = 'Installed:'; +$lang['lastupdate'] = 'Last updated:'; +$lang['downloadurl'] = 'Download URL:'; +$lang['repository'] = 'Repository:'; +$lang['unknown'] = '<em>unknown</em>'; +$lang['installed_version'] = 'Installed version:'; +$lang['install_date'] = 'Your last update:'; +$lang['available_version'] = 'Version:'; +$lang['compatible'] = 'Compatible with:'; +$lang['depends'] = 'Depends on:'; +$lang['similar'] = 'Similar to:'; +$lang['conflicts'] = 'Conflicts with:'; +$lang['donate'] = 'Donate'; +$lang['bundled'] = 'bundled'; +$lang['manual_install'] = 'manual install'; + +$lang['msg_tpl_uninstalled'] = 'Template %s uninstalled'; +$lang['msg_tpl_uninstalled'] = 'Template %s could not be uninstalled'; +$lang['msg_uninstalled'] = 'Plugin %s uninstalled'; +$lang['msg_uninstalled'] = 'Plugin %s could not be uninstalled'; + +$lang['msg_tpl_enabled'] = 'Template %s enabled'; +$lang['msg_tpl_notenabled'] = 'Template %s could not be enabled, check file permissions'; +$lang['msg_enabled'] = 'Plugin %s enabled'; +$lang['msg_notenabled'] = 'Plugin %s could not be enabled, check file permissions'; + +$lang['msg_disabled'] = 'Plugin %s disabled'; +$lang['msg_notdisabled'] = 'Plugin %s could not be disabled, check file permissions'; + +$lang['msg_url_failed'] = 'URL [%s] could not be downloaded.<br /> %s'; +$lang['msg_download_failed'] = 'Plugin %s could not be downloaded.<br /> %s'; +$lang['msg_download_success'] = 'Plugin %s installed successfully'; +$lang['msg_tpl_download_failed'] = 'Template %s could not be downloaded.<br /> %s'; +$lang['msg_tpl_download_success'] = 'Template %s installed successfully'; +$lang['msg_download_pkg_success'] = '%s extension package successfully installed (%s)'; +$lang['msg_tpl_download_pkg_success'] = '%s extension package successfully installed (%s)'; + +$lang['msg_update_success'] = 'Plugin %s successfully updated'; +$lang['msg_update_failed'] = 'Update of plugin %s failed.<br /> %s'; +$lang['msg_tpl_update_success'] = 'Template %s successfully updated'; +$lang['msg_tpl_update_failed'] = 'Update of template %s failed.<br /> %s'; +$lang['msg_update_pkg_success'] = '%s extension package successfully updated (%s)'; +$lang['msg_tpl_update_pkg_success'] = '%s extension package successfully updated (%s)'; + +$lang['msg_reinstall_success'] = 'Plugin %s re-installed successfully'; +$lang['msg_reinstall_failed'] = 'Failed to re-install plugin %s.<br /> %s'; +$lang['msg_tpl_reinstall_success'] = 'Template %s re-installed successfully'; +$lang['msg_tpl_reinstall_failed'] = 'Failed to re-install template %s.<br /> %s'; +$lang['msg_reinstall_pkg_success'] = '%s extension package successfully reinstalled (%s)'; +$lang['msg_tpl_reinstall_pkg_success'] = '%s extension package successfully reinstalled (%s)'; + +// info titles +$lang['plugin'] = 'Plugin'; +$lang['provides'] = 'Provides:'; +$lang['noinfo'] = 'This plugin returned no information, it may be invalid.'; +$lang['name'] = 'Name:'; +$lang['date'] = 'Date:'; +$lang['type'] = 'Type:'; +$lang['desc'] = 'Description:'; +$lang['author'] = 'Author:'; +$lang['www'] = 'Web:'; + +// error messages +$lang['needed_by'] = 'Needed by:'; +$lang['not_writable'] = 'DokuWiki can not write to the folder'; +$lang['missing_dependency'] = '<strong>Missing or disabled dependency:</strong> %s'; +$lang['security_issue'] = '<strong>Security Issue:</strong> %s'; +$lang['security_warning'] = '<strong>Security Warning:</strong> %s'; +$lang['update_available'] = '<strong>Update:</strong> New version %s is available.'; +$lang['wrong_folder'] = '<strong>Plugin installed incorrectly:</strong> Rename plugin directory "%s" to "%s".'; +$lang['url_change'] = '<strong>URL changed:</strong> Download URL has changed since last download. Check if the new URL is valid before updating the extension.<br />New: %s<br />Old: %s'; +$lang['gitmanaged'] = 'Extension installed with git'; +$lang['bundled_source'] = 'Bundled with DokuWiki source'; +$lang['no_url'] = 'No download URL'; +$lang['no_manager'] = 'Could not find manager.dat file'; $lang['error_badurl'] = 'URL ends with slash - unable to determine file name from the url'; $lang['error_dircreate'] = 'Unable to create temporary folder to receive download'; @@ -23,5 +118,4 @@ $lang['error_download'] = 'Unable to download the file: %s'; $lang['error_decompress'] = 'Unable to decompress the downloaded file. This maybe as a result of a bad download, in which case you should try again; or the compression format may be unknown, in which case you will need to download and install manually'; $lang['error_findfolder'] = 'Unable to identify extension directory, you need to download and install manually'; $lang['error_copy'] = 'There was a file copy error while attempting to install files for directory <em>%s</em>: the disk could be full or file access permissions may be incorrect. This may have resulted in a partially installed plugin and leave your wiki installation unstable'; - //Setup VIM: ex: et ts=4 : diff --git a/lib/plugins/extension/style.css b/lib/plugins/extension/style.css new file mode 100644 index 000000000..1cce52be8 --- /dev/null +++ b/lib/plugins/extension/style.css @@ -0,0 +1,368 @@ +/* + * Extension plugin styles + * + * @author Christopher Smith <chris@jalakai.co.uk> + * @author Piyush Mishra <me@piyushmishra.com> + * @author Håkan Sandell <sandell.hakan@gmail.com> + * @author Anika Henke <anika@selfthinker.org> + */ + +/* + * tab support not included in "Angua", copied from _mediamanager.css + */ +#extension__manager .panelHeader { + background-color: __background_alt__; + margin-bottom: 10px; + padding: 10px; + text-align: left; + /* to counter partly missing border of ul.tabs: */ + border-top: 1px solid __border__; + margin-top: -1px; +} + +#extension__manager .panelHeader p { + float: left; + font-weight: normal; + font-size: 1em; + padding: 0; + margin: 0 0 3px; +} +[dir=rtl] #extension__manager .panelHeader p { + float: right; +} + +#extension__manager ul.tabs div.message { + display: inline; + margin: 0 .5em; +} + +/* + * general layout + */ +#extension__manager h2 { + margin-left: 0; +} + +#extension__manager a.taglink { + padding: 1px 4px; + background-color: __background_neu__; + border-radius: 3px; +} +[dir=rtl] #extension__manager a.taglink { + display: inline-block; + line-height: 1.2; +} + +#extension__manager .panelHeader div.error { + margin-top: 0; + float: left; +} +[dir=rtl] #extension__manager .panelHeader div.error { + float: right; +} + +/* + * search & url download forms + */ +#extension__manager form.search, +#extension__manager form.btn_reload { + float: right; +} +[dir=rtl] #extension__manager form.search, +[dir=rtl] #extension__manager form.btn_reload { + float: left; +} + +#extension__manager div.search form.search { + float: none; +} + +#extension__manager .tagcloud { + width: 55%; + float: left; + margin: 0 0.5em 1em 0; +} +[dir=rtl] #extension__manager .tagcloud { + float: right; + margin: 0 0 1em .5em; +} + +#extension__manager .tagcloud a.taglink { + background-color: inherit; +} + +#extension__manager div.search { + width: 44%; + float: left; +} +[dir=rtl] #extension__manager div.search { + float: right; +} + +#extension__manager fieldset { + margin-top: 0.5em; + width: auto; +} + +#extension__manager fieldset p { + margin: 0.5em; + text-align: justify; + font-size: 85%; +} + +/* tag cloud */ +#extension__manager a.cl0 { font-size: 0.7em; } +#extension__manager a.cl1 { font-size: 0.9em; } +#extension__manager a.cl2 { font-size: 1em; } +#extension__manager a.cl3 { font-size: 1.3em; } +#extension__manager a.cl4 { font-size: 1.6em; } +#extension__manager a.cl5 { font-size: 1.9em; } + + +#extension__manager .extensionList input.button { + margin: 0 .3em .3em 0; +} +[dir=rtl] #extension__manager .extensionList input.button { + margin: 0 0 .3em .3em; +} + +/* + * extensions table + */ +#extension__manager .extensionList { + margin-left: 0; + margin-right: 0; + padding: 0; + list-style: none; +} + +#extension__manager .extensionList li { + margin: 0 0 .5em; + padding: 0 0 .5em; + color: __text__; + border-bottom: 1px solid __border__; + overflow: hidden; +} + +#extension__manager .legend { + position: relative; + width: 75%; + float: left; +} +[dir=rtl] #extension__manager .legend { + float: right; +} + +#extension__manager .legend > div { + padding: 0 .5em 0 132px; + border-right: 1px solid __background_alt__; + overflow: hidden; +} +[dir=rtl] #extension__manager .legend > div { + padding: 0 132px 0 .5em; + border-left: 1px solid __background_alt__; + border-right-width: 0; +} + +#extension__manager .enabled div.screenshot span { + background: transparent url(images/enabled.png) no-repeat 2px 2px; +} + +#extension__manager .disabled div.screenshot span { + background: transparent url(images/disabled.png) no-repeat 2px 2px; +} + +#extension__manager .legend div.screenshot { + margin-top: 4px; + margin-left: -132px; + max-width: 120px; + float: left; +} +[dir=rtl] #extension__manager .legend div.screenshot { + margin-left: 0; + margin-right: -132px; + float: right; +} + +#extension__manager .legend div.screenshot span { + min-height: 24px; + min-width: 24px; + position: absolute; + left: 0; +} +[dir=rtl] #extension__manager .legend div.screenshot span { + left: auto; + right: 0; +} + +#extension__manager .legend h2 { + width: 100%; + float: right; + margin: 0.2em 0 0.5em; + font-size: 100%; + font-weight: normal; + border: none; +} +[dir=rtl] #extension__manager .legend h2 { + float: left; +} + +#extension__manager .legend h2 strong { + font-size: 120%; + font-weight: bold; + vertical-align: baseline; +} + +#extension__manager .legend p { + margin: 0 0 0.6em 0; +} + +#extension__manager .legend span.linkbar { + font-size: 85%; +} + +#extension__manager .legend span.linkbar a.urlextern + a.taglink, +#extension__manager .legend span.linkbar a.interwiki + a.taglink { + margin-left: 0.4em; +} +[dir=rtl] #extension__manager .legend span.linkbar a.urlextern + a.taglink, +[dir=rtl] #extension__manager .legend span.linkbar a.interwiki + a.taglink { + margin-left: 0; +} +[dir=rtl] #extension__manager .legend span.linkbar a.urlextern, +[dir=rtl] #extension__manager .legend span.linkbar a.interwiki { + margin-left: .4em; +} + +#extension__manager .legend input.button { + background: transparent url(images/up.png) no-repeat 0 0; + box-shadow: none; + border-width: 0; + height: 14px; + text-indent: -99999px; + float: right; + margin: .5em 0 0; +} +[dir=rtl] #extension__manager .legend input.button { + float: left; + margin: .5em 0 0; +} + +#extension__manager .legend input.button.close { + background: transparent url(images/down.png) no-repeat 0 0; +} + +#extension__manager .legend div.popularity { + background-color: __background__; + border: 1px solid silver; + height: .4em; + margin: 0 auto; + padding: 1px; + width: 5.5em; + position: absolute; + right: .5em; + top: 0.2em; +} +[dir=rtl] #extension__manager .legend div.popularity { + right: auto; + left: .5em; +} + +#extension__manager .legend div.popularity div { + background-color: __border__; + height: 100%; +} + +#extension__manager .legend div.popularity div span { + display: none;/* @todo: hide accessibly */ +} + +#extension__manager .actions { + padding: 0; + font-size: 95%; + width: 25%; + float: right; + text-align: right; +} +[dir=rtl] #extension__manager .actions { + float: left; + text-align: left; +} + +#extension__manager .actions .version { + display: block; +} + +#extension__manager .actions p { + margin: 0.2em 0; + text-align: center; +} + +/* + * extensions table, detailed info box + */ +#extension__manager dl.details { + margin: 0.4em 0 0 0; + font-size: 85%; + border-top: 1px solid __background_alt__; + clear: both; +} + +#extension__manager dl.details dt { + clear: left; + float: left; + width: 25%; + margin: 0; + text-align: right; + font-weight: normal; + padding: 0.2em 5px 0 0; +} +[dir=rtl] #extension__manager dl.details dt { + clear: right; + float: right; + text-align: left; + padding: 0.2em 0 0 5px; +} + +#extension__manager dl.details dd { + margin-left: 25%; + font-weight: bold; + padding: 0.2em 0 0 5px; +} +[dir=rtl] #extension__manager dl.details dd { + margin-left: 0; + margin-right: 25%; + padding: 0.2em 5px 0 0 ; +} + +#extension__manager dl.details dd a { + font-weight: normal; +} + +#extension__manager #info__popup { + z-index: 20; + overflow: hidden; + opacity: 0.9; + border: 1px solid __border__; + background-color: __border__; /*background_other__;*/ + text-align: left; + padding: 0.2em; +} +[dir=rtl] #extension__manager #info__popup { + text-align: right; +} + +#extension__manager div.msg { + margin: 0.4em 0 0 0; +} + +#extension__manager ul.tabs div.msg { + display: inline; + margin-left: 0.4em; +} +[dir=rtl] #extension__manager ul.tabs div.msg { + margin-left: 0; + margin-right: 0.4em; +} + +/* end admin plugin styles */ |