Lines Matching defs:extension
6 * DokuWiki Plugin extension (Helper Component)
31 * Initialize the extension table form
39 * Build single row of extension table
41 * @param helper_plugin_extension_extension $extension The extension that shall be added
44 public function addRow(helper_plugin_extension_extension $extension, $showinfo = false)
46 $this->startRow($extension);
47 $this->populateColumn('legend', $this->makeLegend($extension, $showinfo));
48 $this->populateColumn('actions', $this->makeActions($extension));
117 * Start the HTML for the row for the extension
119 * @param helper_plugin_extension_extension $extension The extension
121 private function startRow(helper_plugin_extension_extension $extension)
123 $this->form .= '<li id="extensionplugin__' . hsc($extension->getID()) .
124 '" class="' . $this->makeClass($extension) . '">';
148 * @param helper_plugin_extension_extension $extension The extension
151 public function makeHomepageLink(helper_plugin_extension_extension $extension)
154 $url = $extension->getURL();
176 * Generate the class name for the row of the extension
178 * @param helper_plugin_extension_extension $extension The extension object
181 public function makeClass(helper_plugin_extension_extension $extension)
183 $class = ($extension->isTemplate()) ? 'template' : 'plugin';
184 if ($extension->isInstalled()) {
186 $class .= ($extension->isEnabled()) ? ' enabled' : ' disabled';
187 if ($extension->updateAvailable()) $class .= ' updatable';
189 if (!$extension->canModify()) $class .= ' notselect';
190 if ($extension->isProtected()) $class .= ' protected';
196 * Generate a link to the author of the extension
198 * @param helper_plugin_extension_extension $extension The extension object
201 public function makeAuthor(helper_plugin_extension_extension $extension)
203 if ($extension->getAuthor()) {
204 $mailid = $extension->getEmailID();
210 hsc($extension->getAuthor()) . '</a>';
212 $html = '<span class="author">' . hsc($extension->getAuthor()) . '</span>';
224 * @param helper_plugin_extension_extension $extension The extension object
227 public function makeScreenshot(helper_plugin_extension_extension $extension)
229 $screen = $extension->getScreenshotURL();
230 $thumb = $extension->getThumbnailURL();
237 $title = sprintf($this->getLang('screenshot'), hsc($extension->getDisplayName()));
241 } elseif ($extension->isTemplate()) {
243 'lib/plugins/extension/images/template.png" />';
246 'lib/plugins/extension/images/plugin.png" />';
255 * @param helper_plugin_extension_extension $extension The extension object
259 public function makeLegend(helper_plugin_extension_extension $extension, $showinfo = false)
265 '<bdi>' . hsc($extension->getDisplayName()) . '</bdi>',
266 $this->makeAuthor($extension)
270 $html .= $this->makeScreenshot($extension);
272 $popularity = $extension->getPopularity();
273 if ($popularity !== false && !$extension->isBundled()) {
281 if ($extension->getDescription()) {
283 $html .= hsc($extension->getDescription()) . ' ';
287 $html .= $this->makeLinkbar($extension);
293 $url = $this->gui->tabURL('', ['info' => $extension->getID()]);
296 $html .= ' <a href="' . $url . '#extensionplugin__' . $extension->getID() .
298 '" data-extid="' . $extension->getID() . '">' . $this->getLang('btn_info') . '</a>';
301 $html .= $this->makeInfo($extension);
303 $html .= $this->makeNoticeArea($extension);
311 * @param helper_plugin_extension_extension $extension The extension instance
314 public function makeLinkbar(helper_plugin_extension_extension $extension)
318 $html .= $this->makeHomepageLink($extension);
320 $bugtrackerURL = $extension->getBugtrackerURL();
340 if ($extension->getTags()) {
343 foreach ($extension->getTags() as $tag) {
361 * @param helper_plugin_extension_extension $extension The extension
364 public function makeNoticeArea(helper_plugin_extension_extension $extension)
367 $missing_dependencies = $extension->getMissingDependencies();
376 if ($extension->isInWrongFolder()) {
380 '<bdi>' . hsc($extension->getInstallName()) . '</bdi>',
381 '<bdi>' . hsc($extension->getBase()) . '</bdi>'
385 if (($securityissue = $extension->getSecurityIssue()) !== false) {
390 if (($securitywarning = $extension->getSecurityWarning()) !== false) {
395 if (($updateMessage = $extension->getUpdateMessage()) !== false) {
400 if ($extension->updateAvailable()) {
402 sprintf($this->getLang('update_available'), hsc($extension->getLastUpdate())) .
405 if ($extension->hasDownloadURLChanged()) {
409 '<bdi>' . hsc($extension->getDownloadURL()) . '</bdi>',
410 '<bdi>' . hsc($extension->getLastDownloadURL()) . '</bdi>'
443 * @param helper_plugin_extension_extension $extension The extension
446 public function makeInfo(helper_plugin_extension_extension $extension)
452 $html .= '<dd>' . $this->makeStatus($extension) . '</dd>';
454 if ($extension->getDonationURL()) {
457 $html .= '<a href="' . $extension->getDonationURL() . '" class="donate">' .
462 if (!$extension->isBundled()) {
465 $html .= ($extension->getDownloadURL()
466 ? $this->shortlink($extension->getDownloadURL())
472 $html .= ($extension->getSourcerepoURL()
473 ? $this->shortlink($extension->getSourcerepoURL())
478 if ($extension->isInstalled()) {
479 if ($extension->getInstalledVersion()) {
482 $html .= hsc($extension->getInstalledVersion());
485 if (!$extension->isBundled()) {
488 $html .= ($extension->getUpdateDate()
489 ? hsc($extension->getUpdateDate())
494 if (!$extension->isInstalled() || $extension->updateAvailable()) {
497 $html .= ($extension->getLastUpdate()
498 ? hsc($extension->getLastUpdate())
505 $html .= ($extension->getTypes()
506 ? hsc(implode(', ', $extension->getTypes()))
510 if (!$extension->isBundled() && $extension->getCompatibleVersions()) {
513 foreach ($extension->getCompatibleVersions() as $date => $version) {
519 if ($extension->getDependencies()) {
522 $html .= $this->makeLinkList($extension->getDependencies());
526 if ($extension->getSimilarExtensions()) {
529 $html .= $this->makeLinkList($extension->getSimilarExtensions());
533 if ($extension->getConflicts()) {
536 $html .= $this->makeLinkList($extension->getConflicts());
563 * @param helper_plugin_extension_extension $extension The extension
566 public function makeActions(helper_plugin_extension_extension $extension)
572 if ($extension->isInstalled()) {
573 if (($canmod = $extension->canModify()) === true) {
574 if (!$extension->isProtected()) {
575 $html .= $this->makeAction('uninstall', $extension);
577 if ($extension->getDownloadURL()) {
578 if ($extension->updateAvailable()) {
579 $html .= $this->makeAction('update', $extension);
581 $html .= $this->makeAction('reinstall', $extension);
587 if (!$extension->isProtected() && !$extension->isTemplate()) { // no enable/disable for templates
588 if ($extension->isEnabled()) {
589 $html .= $this->makeAction('disable', $extension);
591 $html .= $this->makeAction('enable', $extension);
594 if ($extension->isGitControlled()) {
598 $extension->isEnabled() &&
599 in_array('Auth', $extension->getTypes()) &&
600 $conf['authtype'] != $extension->getID()
604 } elseif (($canmod = $extension->canModify()) === true) {
605 if ($extension->getDownloadURL()) {
606 $html .= $this->makeAction('install', $extension);
612 if (!$extension->isInstalled() && $extension->getDownloadURL()) {
614 $html .= ($extension->getLastUpdate()
615 ? hsc($extension->getLastUpdate())
623 * Display an action button for an extension
626 * @param helper_plugin_extension_extension $extension The extension
629 public function makeAction($action, $extension)
634 $title = 'title="' . hsc($extension->getDownloadURL()) . '"';
638 $name = 'fn[' . $action . '][' . hsc($extension->getID()) . ']';
648 * @param helper_plugin_extension_extension $extension The extension
651 public function makeStatus(helper_plugin_extension_extension $extension)
655 if ($extension->isInstalled()) {
657 if ($extension->isProtected()) {
660 $status[] = $extension->isEnabled()
667 if (!$extension->canModify()) $status[] = $this->getLang('status_unmodifiable');
668 if ($extension->isBundled()) $status[] = $this->getLang('status_bundled');
669 $status[] = $extension->isTemplate()