コード例 #1
0
 $table = table::factory();
 $table->addCollsLayout('20,*,215');
 $table->addRow()->addCell('')->addCell(lang::get('name'))->addCell(lang::get('actions'));
 $table->addSection('tbody');
 $addons = scandir(dir::backend('addons' . DIRECTORY_SEPARATOR));
 if (count($addons)) {
     foreach ($addons as $dir) {
         if (in_array($dir, ['.', '..', '.htaccess'])) {
             continue;
         }
         $curAddon = new addon($dir);
         $install_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'install']);
         $active_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'active']);
         $delete_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'delete']);
         $help_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'help']);
         if ($curAddon->isInstall()) {
             $install = '<a href="' . $install_url . '" class="btn btn-sm dyn-online">' . lang::get('addon_installed') . '</a>';
         } else {
             $install = '<a href="' . $install_url . '" class="btn btn-sm dyn-offline">' . lang::get('addon_not_installed') . '</a>';
         }
         if ($curAddon->isActive()) {
             $active = '<a href="' . $active_url . '" class="btn btn-sm dyn-online fa fa-check" title="' . lang::get('addon_actived') . '"></a>';
         } else {
             $active = '<a href="' . $active_url . '" class="btn btn-sm dyn-offline fa fa-times" title="' . lang::get('addon_not_actived') . '"></a>';
         }
         $delete = '<a href="' . $delete_url . '" class="btn btn-sm btn-danger fa fa-trash-o delete"></a>';
         $table->addRow()->addCell('<a class="fa fa-question" href="' . $help_url . '"></a>')->addCell($curAddon->get('name') . ' <small>' . $curAddon->get('version') . '</small>')->addCell('<span class="btn-group">' . $install . $active . $delete . '</span>');
     }
 } else {
     $table->addRow()->addCell(lang::get('no_entries'), ['colspan' => 3]);
 }
コード例 #2
0
ファイル: addons.php プロジェクト: DINKIN/rokket
    $table->addRow()->addCell('')->addCell(lang::get('name'))->addCell(lang::get('status'))->addCell('');
    $table->addSection('tbody');
    $addons = array_diff(scandir(dir::base('addons' . DIRECTORY_SEPARATOR)), ['.', '..', '.htaccess']);
    if (count($addons)) {
        foreach ($addons as $dir) {
            $curAddon = new addon($dir);
            $status = '';
            $delete = '<a href="?page=addons&addon=' . $dir . '&action=delete" class="delete"></a>';
            $status .= '
				<form action="" method="get">
					<input type="hidden" name="page" value="addons">
					<input type="hidden" name="addon" value="' . $dir . '">
					<select class="addonAction" name="action">';
            if ($curAddon->isActive()) {
                $status .= '<option selected="selected" value="">' . lang::get('addon_actived') . '</option>';
            } elseif ($curAddon->isInstall()) {
                $status .= '<option selected="selected" value="">' . lang::get('addon_installed') . '</option>';
            } else {
                $status .= '<option selected="selected" value="">' . lang::get('addon_not_installed') . '</option>';
            }
            if ($curAddon->isInstall()) {
                $status .= '<option value="install">' . lang::get('uninstall') . '</option>';
            } else {
                $status .= '<option value="install">' . lang::get('install') . '</option>';
            }
            if ($curAddon->isActive()) {
                $status .= '<option value="active">' . lang::get('deactivate') . '</option>';
            } else {
                $status .= '<option value="active">' . lang::get('activate') . '</option>';
            }
            $status .= '<option value="delete">' . lang::get('delete') . '</option>';