aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php42
-rw-r--r--mod/import.php3
-rw-r--r--mod/menu.php8
-rw-r--r--mod/mitem.php4
-rw-r--r--mod/profile_photo.php32
5 files changed, 41 insertions, 48 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 89207e4fa..2b7bb007d 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -84,48 +84,6 @@ function admin_content(&$a) {
return login(false);
}
- /*
- * Side bar links
- */
-
- // array( url, name, extra css classes )
-
- $aside = array(
- 'site' => array($a->get_baseurl(true)."/admin/site/", t("Site") , "site"),
- 'users' => array($a->get_baseurl(true)."/admin/users/", t("Accounts") , "users"),
- 'channels' => array($a->get_baseurl(true)."/admin/channels/", t("Channels") , "channels"),
- 'plugins' => array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"),
- 'themes' => array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"),
- 'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'),
-// 'hubloc' => array($a->get_baseurl(true)."/admin/hubloc/", t("Server") , "server"),
- 'profs' => array(z_root() . '/admin/profs', t('Profile Config'), 'profs'),
- 'dbsync' => array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync")
-
- );
-
- /* get plugins admin page */
-
- $r = q("SELECT * FROM addon WHERE plugin_admin = 1");
- $aside['plugins_admin'] = array();
- foreach ($r as $h){
- $plugin = $h['name'];
- $aside['plugins_admin'][] = array($a->get_baseurl(true) . '/admin/plugins/' . $plugin, $plugin, 'plugin');
- // 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");
- $a->page['aside'] .= replace_macros( $t, array(
- '$admin' => $aside,
- '$admtxt' => t('Admin'),
- '$plugadmtxt' => t('Plugin Features'),
- '$logtxt' => t('Logs'),
- '$h_pending' => t('User registrations waiting for confirmation'),
- '$admurl'=> $a->get_baseurl(true)."/admin/"
- ));
-
/*
* Page content
diff --git a/mod/import.php b/mod/import.php
index 27c2094c3..0e43d2444 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -443,6 +443,9 @@ function import_post(&$a) {
if(is_array($data['event_item']))
import_items($channel,$data['event_item']);
+
+ if(is_array($data['menu']))
+ import_menus($channel,$data['menu']);
$saved_notification_flags = notifications_off($channel['channel_id']);
diff --git a/mod/menu.php b/mod/menu.php
index 7763c4ed1..bfc45adef 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -37,6 +37,7 @@ function menu_post(&$a) {
$_REQUEST['menu_id'] = intval(argv(1));
$r = menu_edit($_REQUEST);
if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$menu_id);
//info( t('Menu updated.') . EOL);
goaway(z_root() . '/mitem/' . $menu_id . (($a->is_sys) ? '?f=&sys=1' : ''));
}
@@ -45,7 +46,9 @@ function menu_post(&$a) {
}
else {
$r = menu_create($_REQUEST);
- if($r) {
+ if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$r);
+
//info( t('Menu created.') . EOL);
goaway(z_root() . '/mitem/' . $r . (($a->is_sys) ? '?f=&sys=1' : ''));
}
@@ -56,6 +59,8 @@ function menu_post(&$a) {
}
+
+
function menu_content(&$a) {
$uid = local_channel();
@@ -121,6 +126,7 @@ function menu_content(&$a) {
if(intval(argv(1))) {
if(argc() == 3 && argv(2) == 'drop') {
+ menu_sync_packet($uid,get_observer_hash(),intval(argv(1)),true);
$r = menu_delete_id(intval(argv(1)),$uid);
if(!$r)
notice( t('Menu could not be deleted.'). EOL);
diff --git a/mod/mitem.php b/mod/mitem.php
index 0fadd1548..d6572bd56 100644
--- a/mod/mitem.php
+++ b/mod/mitem.php
@@ -64,6 +64,7 @@ function mitem_post(&$a) {
$_REQUEST['mitem_id'] = $mitem_id;
$r = menu_edit_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
//info( t('Menu element updated.') . EOL);
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . (($a->is_sys) ? '?f=&sys=1' : ''));
}
@@ -74,6 +75,7 @@ function mitem_post(&$a) {
else {
$r = menu_add_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
//info( t('Menu element added.') . EOL);
if($_REQUEST['submit']) {
goaway(z_root() . '/menu' . (($a->is_sys) ? '?f=&sys=1' : ''));
@@ -202,7 +204,9 @@ function mitem_content(&$a) {
$lockstate = (($mitem['allow_cid'] || $mitem['allow_gid'] || $mitem['deny_cid'] || $mitem['deny_gid']) ? 'lock' : 'unlock');
if(argc() == 4 && argv(3) == 'drop') {
+ menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
$r = menu_del_item($mitem['mitem_menu_id'], $uid, intval(argv(2)));
+ menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
if($r)
info( t('Menu item deleted.') . EOL);
else
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 13923a655..9f57c3b9d 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -130,7 +130,7 @@ function profile_photo_post(&$a) {
if($r) {
$base_image = $r[0];
- $base_image['data'] = dbunescbin($base_image['data']);
+ $base_image['data'] = (($r[0]['os_storage']) ? @file_get_contents($base_image['data']) : dbunescbin($base_image['data']));
$im = photo_factory($base_image['data'], $base_image['type']);
if($im->is_valid()) {
@@ -332,7 +332,7 @@ function profile_photo_content(&$a) {
goaway($a->get_baseurl() . '/profiles');
}
- $r = q("SELECT `data`, `type` FROM photo WHERE id = %d and uid = %d limit 1",
+ $r = q("SELECT `data`, `type`, resource_id, os_storage FROM photo WHERE id = %d and uid = %d limit 1",
intval($r[0]['id']),
intval(local_channel())
@@ -342,9 +342,31 @@ function profile_photo_content(&$a) {
return;
}
- $ph = photo_factory(dbunescbin($r[0]['data']), $r[0]['type']);
- // go ahead as if we have just uploaded a new photo to crop
- profile_photo_crop_ui_head($a, $ph);
+ if(intval($r[0]['os_storage']))
+ $data = @file_get_contents($r[0]['data']);
+ else
+ $data = dbunescbin($r[0]['data']);
+
+ $ph = photo_factory($data, $r[0]['type']);
+ $smallest = 0;
+ if($ph->is_valid()) {
+ // go ahead as if we have just uploaded a new photo to crop
+ $i = q("select resource_id, scale from photo where resource_id = '%s' and uid = %d order by scale",
+ dbesc($r[0]['resource_id']),
+ intval(local_channel())
+ );
+
+ if($i) {
+ $hash = $i[0]['resource_id'];
+ foreach($i as $ii) {
+ if(intval($ii['scale']) < 2) {
+ $smallest = intval($ii['scale']);
+ }
+ }
+ }
+ }
+
+ profile_photo_crop_ui_head($a, $ph, $hash, $smallest);
}
$profiles = q("select id, profile_name as name, is_default from profile where uid = %d",