示例#1
0
					
				}				
				if ($mv >= $v) {
					$filtmod[$k] = $m;
				}
			}
			if (count(array_keys($filtmod)) > 0) {
				$filtered[$t] = $filtmod;
			}
		}
	}
	$display = $filtered;
}
$smarty->assign('display', $display);
if (isset($_REQUEST['focus'])) {
	$focus = $_REQUEST['focus'];
	$more = new TikiModInfo($focus);
	$err = $more->readinfo($prefs['mods_dir'] . '/Packages/' . $focus . '.info.txt');
	if ($err !== false) die($err);
} else {
	$focus = false;
	$more = array();
}
$smarty->assign('focus', $focus);
$smarty->assign('more', $more);
$smarty->assign('tikifeedback', $feedback);
$smarty->assign('types', $types);
$smarty->assign('versions', $versions);
$smarty->assign('mid', 'tiki-mods.tpl');
$smarty->display("tiki.tpl");
示例#2
0
文件: modslib.php 项目: rjsmelo/tiki
 /**
  * @param $path
  * @param $mod
  * @param bool $upgrade
  * @return bool
  */
 function remove($path, $mod, $upgrade = false)
 {
     $this->feedback_info("removing " . $mod->modname . " (" . $mod->revision . ") ...");
     $file = $path . '/Installed/' . $mod->modname . '.info.txt';
     if (is_file($file)) {
         $info = new TikiModInfo($mod->modname);
         $err = $info->readinfo($file);
         if ($err !== false) {
             $this->feedback_error($err);
             return false;
         }
         if (!$upgrade and is_array($info->sql_remove) and count($info->sql_remove)) {
             global $tikilib;
             foreach ($info->sql_remove as $sql) {
                 $tikilib->query($sql, array());
             }
         }
         if (isset($info->files) and count($info->files)) {
             foreach ($info->files as $f) {
                 if (!@unlink($f[1])) {
                     $this->feedback_warning(sprintf(tra("%s impossible to remove"), $f[1]));
                 }
                 if (is_file($f[1] . '.orig.' . $info->revision)) {
                     rename($f[1] . '.orig.' . $info->revision, $f[1]);
                 }
             }
         }
         unlink($file);
         $this->rebuild_list($path . '/Installed/');
         if (is_file($path . '/Installed/' . $info->type . '-' . $info->name . '.conf.txt')) {
             unlink($path . '/Installed/' . $info->type . '-' . $info->name . '.conf.txt');
         }
         return $info->revision;
     } else {
         $this->feedback_warning("'{$file}' was not found for removing");
     }
 }