コード例 #1
0
ファイル: ThemeController.php プロジェクト: Andyyang1981/pi
 /**
  * AJAX: Uninstall a theme and remove its asset
  *
  * @return array
  */
 public function uninstallAction()
 {
     $status = 1;
     $themeName = $this->params('name');
     if ('default' == $themeName) {
         $status = 0;
         $message = _a('Default theme is protected from uninstallation.');
     } else {
         $installer = new ThemeInstaller();
         $ret = $installer->uninstall($themeName);
         $message = '';
         if (!$ret) {
             $status = 0;
             $message = $installer->renderMessage() ?: sprintf(_a('The theme "%s" is not uninstalled.'), $themeName);
         }
     }
     $message = $message ?: sprintf(_a('The theme "%s" is uninstalled.'), $themeName);
     $result = array('status' => $status, 'message' => $message);
     return $result;
 }