コード例 #1
0
ファイル: ThemeController.php プロジェクト: Andyyang1981/pi
 /**
  * AJAX: Update a theme, and re-publish its asset
  *
  * @return array
  */
 public function updateAction()
 {
     $status = 1;
     $themeName = $this->params('name');
     $installer = new ThemeInstaller();
     $ret = $installer->update($themeName);
     $message = '';
     if (!$ret) {
         $status = 0;
         $message = $installer->renderMessage() ?: sprintf(_a('The theme "%s" is not updated.'), $themeName);
     }
     $message = $message ?: sprintf(_a('The theme "%s" is updated.'), $themeName);
     $themelist = Pi::registry('themelist')->read();
     return $themelist[$themeName];
 }