q("DELETE FROM `addon` WHERE `name` = '%s' ",
dbesc($plugin)
);
-
+
@include_once('addon/' . $plugin . '/' . $plugin . '.php');
if(function_exists($plugin . '_uninstall')) {
$func = $plugin . '_uninstall';
if(function_exists($plugin . '_install')) {
$func = $plugin . '_install';
$func();
-
+
$plugin_admin = (function_exists($plugin."_plugin_admin")?1:0);
-
+
$r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`, `plugin_admin`) VALUES ( '%s', 1, %d , %d ) ",
dbesc($plugin),
intval($t),
if (! function_exists('get_plugin_info')){
function get_plugin_info($plugin){
+
+ $a = get_app();
+
$info=Array(
'name' => $plugin,
'description' => "",
$info[$k]=$v;
}
}
-
+
}
}
-
+
}
return $info;
}}
/*
* parse theme comment in search of theme infos.
* like
- *
+ *
* * Name: My Theme
* * Description: My Cool Theme
* * Version: 1.2.3
if (!is_file("view/theme/$theme/theme.php")) return $info;
+ $a = get_app();
$stamp1 = microtime(true);
$f = file_get_contents("view/theme/$theme/theme.php");
$a->save_timestamp($stamp1, "file");
if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
return;
-
+
// urls
}
info(t('Theme settings updated.'));
if(is_ajax()) return;
-
+
goaway($a->get_baseurl(true) . '/admin/themes/' . $theme );
return;
break;
'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"),
//'update' => Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update")
);
-
+
/* get plugins admin page */
-
+
$r = q("SELECT * FROM `addon` WHERE `plugin_admin`=1");
$aside['plugins_admin']=Array();
foreach ($r as $h){
// temp plugins with admin
$a->plugins_admin[] = $plugin;
}
-
+
$aside['logs'] = Array($a->get_baseurl(true)."/admin/logs/", t("Logs"), "logs");
$t = get_markup_template("admin_aside.tpl");
* Page content
*/
$o = '';
-
// urls
if ($a->argc > 1){
switch ($a->argv[1]){
} else {
$o = admin_page_summary($a);
}
-
+
if(is_ajax()) {
echo $o;
killme();
}
}
}
-
-
+
+
/* Banner */
$banner = get_config('system','banner');
if($banner == false)
$banner = '<a href="http://friendica.com"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendica.com">Friendica</a></span>';
$banner = htmlspecialchars($banner);
-
+
//echo "<pre>"; var_dump($lang_choices); die("</pre>");
/* Register policy */
* @return string
*/
function admin_page_plugins(&$a){
-
+
/**
* Single plugin
*/
notice( t("Item not found.") );
return '';
}
-
+
if (x($_GET,"a") && $_GET['a']=="t"){
- check_form_security_token_redirectOnErr('/admin/plugins', 'admin_themes', 't');
+ check_form_security_token_redirectOnErr('/admin/plugins', 'admin_themes', 't');
// Toggle plugin status
$idx = array_search($plugin, $a->plugins);
} else {
$status="off"; $action= t("Enable");
}
-
+
$readme=Null;
if (is_file("addon/$plugin/README.md")){
$readme = file_get_contents("addon/$plugin/README.md");
$readme = Markdown($readme);
} else if (is_file("addon/$plugin/README")){
$readme = "<pre>". file_get_contents("addon/$plugin/README") ."</pre>";
- }
-
+ }
+
$admin_form="";
if (is_array($a->plugins_admin) && in_array($plugin, $a->plugins_admin)){
@require_once("addon/$plugin/$plugin.php");
$func = $plugin.'_plugin_admin';
$func($a, $admin_form);
}
-
+
$t = get_markup_template("admin_plugins_details.tpl");
+
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => $a->get_baseurl(true),
-
+
'$plugin' => $plugin,
'$status' => $status,
'$action' => $action,
'$info' => get_plugin_info($plugin),
'$str_author' => t('Author: '),
- '$str_maintainer' => t('Maintainer: '),
-
+ '$str_maintainer' => t('Maintainer: '),
+
'$admin_form' => $admin_form,
'$function' => 'plugins',
'$screenshot' => '',
'$readme' => $readme,
- '$form_security_token' => get_form_security_token("admin_themes"),
+ '$form_security_token' => get_form_security_token("admin_themes"),
));
- }
-
-
-
+ }
+
+
+
/**
* List plugins
*/
-
+
$plugins = array();
$files = glob("addon/*/");
if($files) {
}
}
}
-
+
$t = get_markup_template("admin_plugins.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
return $o;
}
-
+
/**
* Themes admin page
*
* @return string
*/
function admin_page_themes(&$a){
-
+
$allowed_themes_str = get_config('system','allowed_themes');
$allowed_themes_raw = explode(',',$allowed_themes_str);
$allowed_themes = array();
notice( t("Item not found.") );
return '';
}
-
+
if (x($_GET,"a") && $_GET['a']=="t"){
- check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
+ check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
// Toggle theme status
} else {
$status="off"; $action= t("Enable");
}
-
+
$readme=Null;
if (is_file("view/theme/$theme/README.md")){
$readme = file_get_contents("view/theme/$theme/README.md");
$readme = Markdown($readme);
} else if (is_file("view/theme/$theme/README")){
$readme = "<pre>". file_get_contents("view/theme/$theme/README") ."</pre>";
- }
-
+ }
+
$admin_form="";
if (is_file("view/theme/$theme/config.php")){
require_once("view/theme/$theme/config.php");
if(function_exists("theme_admin")){
$admin_form = theme_admin($a);
}
-
+
}
-
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
if(! stristr($screenshot[0],$theme))
- $screenshot = null;
+ $screenshot = null;
$t = get_markup_template("admin_plugins_details.tpl");
return replace_macros($t, array(
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => $a->get_baseurl(true),
-
+
'$plugin' => $theme,
'$status' => $status,
'$action' => $action,
'$form_security_token' => get_form_security_token("admin_themes"),
));
- }
-
-
-
+ }
+
/**
* List themes
*/
-
+
$xthemes = array();
if($themes) {
foreach($themes as $th) {
$xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"), get_theme_info($th['name']));
}
}
-
+
$t = get_markup_template("admin_plugins.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
if(x($_GET,'nets')) {
$network = $_GET['nets'];
}
-
+
return $network;
}
// item filter tabs
// TODO: fix this logic, reduce duplication
//$a->page['content'] .= '<div class="tabs-wrapper">';
-
+
list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a);
// if no tabs are selected, defaults to comments
if ($no_active=='active') $all_active='active';
//echo "<pre>"; var_dump($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active); killme();
$cmd = (($datequery) ? '' : $a->cmd);
- $len_naked_cmd = strlen(str_replace('/new','',$cmd));
+ $len_naked_cmd = strlen(str_replace('/new','',$cmd));
// tabs
$tabs = array(
// 'url'=>$a->get_baseurl(true) . '/network?f=&spam=1'
// 'sel'=> $spam_active,
// 'title' => t('Posts flagged as SPAM'),
-// ),
+// ),
);
-
+
if(feature_enabled(local_user(),'personal_tab')) {
$tabs[] = array(
'label' => t('Personal'),
}
- // We don't have to deal with ACL's on this page. You're looking at everything
+ // We don't have to deal with ACLs on this page. You're looking at everything
// that belongs to you, hence you can see all of it. We will filter by group if
// desired.
-
+
$sql_options = (($star) ? " and starred = 1 " : '');
$sql_options .= (($bmark) ? " and bookmark = 1 " : '');