Esempio n. 1
0
 } else {
     $id = $_GPC['templateid'];
 }
 $theme = pdo_fetch("SELECT id, name, title FROM " . tablename('site_templates') . " WHERE name = :name", array(':name' => $id));
 if (empty($theme)) {
     if ($batch == 1) {
         cache_write('upgrade:template', iserializer($wait_upgrade));
         message($theme['title'] . ' 模板已经被卸载或是不存在。系统将进入下一个模板的更新。<br>请勿关闭浏览器', url('extension/theme/upgrade', array('batch' => 1)), 'success');
     }
     message('模板已经被卸载或是不存在!', '', 'error');
 }
 $r = cloud_prepare();
 if (is_error($r)) {
     message($r['message'], url('cloud/profile'), 'error');
 }
 $info = cloud_t_info($id);
 $upgrade_info = cloud_t_upgradeinfo($id);
 if (is_error($upgrade_info)) {
     message($upgrade_info['message'], referer(), 'error');
 }
 if ($_W['isajax']) {
     message($upgrade_info, '', 'ajax');
 }
 if (!is_error($info)) {
     if (empty($_GPC['flag'])) {
         if (intval($_GPC['branch']) > $upgrade_info['version']['branch_id']) {
             header('location: ' . url('cloud/redirect/buybranch', array('m' => $id, 'branch' => intval($_GPC['branch']), 'type' => 'theme', 'is_upgrade' => 1)));
             exit;
         }
         load()->func('file');
         rmdirs(IA_ROOT . '/app/themes/' . $id, true);
Esempio n. 2
0
function ext_template_manifest($tpl, $cloud = true)
{
    $filename = IA_ROOT . '/app/themes/' . $tpl . '/manifest.xml';
    if (!file_exists($filename)) {
        if ($cloud) {
            load()->model('cloud');
            $manifest = cloud_t_info($tpl);
        }
        return is_error($manifest) ? array() : $manifest;
    }
    $manifest = ext_template_manifest_parse(file_get_contents($filename));
    if (empty($manifest['name']) || $manifest['name'] != $tpl) {
        return array();
    }
    return $manifest;
}