public function do_uninstall_package() { $pkgID = $this->post('pkgID'); $valt = Loader::helper('validation/token'); if ($pkgID > 0) { $pkg = Package::getByID($pkgID); } if (!$valt->validate('uninstall')) { $this->error->add($valt->getErrorMessage()); } $tp = new TaskPermission(); if (!$tp->canUninstallPackages()) { $this->error->add(t('You do not have permission to uninstall packages.')); } if (!is_object($pkg)) { $this->error->add(t('Invalid package.')); } if (!$this->error->has()) { $pkg->uninstall(); if ($this->post('pkgMoveToTrash')) { $r = $pkg->backup(); if (is_array($r)) { $pe = Package::mapError($r); foreach($pe as $ei) { $this->error->add($ei); } } } if (!$this->error->has()) { $this->redirect('/dashboard/extend/install', 'package_uninstalled'); } } if ($this->error->has()) { $this->set('error', $this->error); } $this->inspect_package($pkgID); }
<td class="ccm-addon-list-description"><h3><?=$bt->getBlockTypeName()?></a></h3><?=$bt->getBlockTypeDescription()?></td> <td><div style="width: 80px"><?=$ch->button(t("Edit"), View::url('/dashboard/install', 'inspect_block_type', $bt->getBlockTypeID()))?></div></td> </tr> </table> </div> <? } ?> <br/><br/> <? } ?> <div class="ccm-spacer"> </div> <? $tp = new TaskPermission(); if ($tp->canUninstallPackages()) { $buttons[] = $ch->button(t('Uninstall Package'), $this->url('/dashboard/install', 'uninstall', $pkg->getPackageID()), 'left'); print $ch->buttons($buttons); } ?> </div> <? } else if (is_object($bt)) { ?> <h1><span><?=$bt->getBlockTypeName()?></span></h1> <div class="ccm-dashboard-inner"> <img src="<?=$ci->getBlockTypeIconURL($bt)?>" style="float: right" />