aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-02 00:10:05 -0800
committerfriendica <info@friendica.com>2012-03-02 00:10:05 -0800
commit90bdddca0d1b2e2128646d1f698b6d514e748001 (patch)
tree2e7855a389313397b310a70b0e6072a5ba6dcce1 /mod
parentbe231e346658eb68e518324ba995aaccb7abd055 (diff)
parent3a609adfb77a94d5b8681496a9306d9cf4efcafb (diff)
downloadvolse-hubzilla-90bdddca0d1b2e2128646d1f698b6d514e748001.tar.gz
volse-hubzilla-90bdddca0d1b2e2128646d1f698b6d514e748001.tar.bz2
volse-hubzilla-90bdddca0d1b2e2128646d1f698b6d514e748001.zip
Merge branch 'pull'
Diffstat (limited to 'mod')
-rwxr-xr-xmod/admin.php7
-rwxr-xr-xmod/group.php80
2 files changed, 44 insertions, 43 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 0f600e312..94bf44503 100755
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -366,7 +366,7 @@ function admin_page_users_post(&$a){
intval( $uid )
);
}
- notice( sprintf( tt("%s user blocked", "%s users blocked/unblocked", count($users)), count($users)) );
+ notice( sprintf( tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)) );
}
if (x($_POST,'page_users_delete')){
require_once("include/Contact.php");
@@ -428,6 +428,7 @@ function admin_page_users(&$a){
LEFT JOIN `contact` ON `register`.`uid` = `contact`.`uid`
LEFT JOIN `user` ON `register`.`uid` = `user`.`uid`;");
+
/* get users */
$total = q("SELECT count(*) as total FROM `user` where 1");
@@ -435,7 +436,8 @@ function admin_page_users(&$a){
$a->set_pager_total($total[0]['total']);
$a->set_pager_itemspage(100);
}
-
+
+
$users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date`
FROM
(SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid`
@@ -469,6 +471,7 @@ function admin_page_users(&$a){
}
$users = array_map("_setup_users", $users);
+
$t = get_markup_template("admin_users.tpl");
$o = replace_macros($t, array(
// strings //
diff --git a/mod/group.php b/mod/group.php
index c896362ca..f6f8e4173 100755
--- a/mod/group.php
+++ b/mod/group.php
@@ -76,14 +76,17 @@ function group_content(&$a) {
if($switchtotext === false)
$switchtotext = 400;
+ $tpl = get_markup_template('group_edit.tpl');
+ $context = array('$submit' => t('Submit'));
+
if(($a->argc == 2) && ($a->argv[1] === 'new')) {
- $tpl = get_markup_template('group_new.tpl');
- $o .= replace_macros($tpl,array(
- '$desc' => t('Create a group of contacts/friends.'),
- '$name' => t('Group Name: '),
- '$submit' => t('Submit')
- ));
- return $o;
+
+ return replace_macros($tpl, $context + array(
+ '$title' => t('Create a group of contacts/friends.'),
+ '$gname' => array('groupname',t('Group Name: '),$group['name'], ''),
+ ));
+
+
}
if(($a->argc == 3) && ($a->argv[1] === 'drop')) {
@@ -156,66 +159,61 @@ function group_content(&$a) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
- $tpl = get_markup_template('group_edit.tpl');
- $o .= replace_macros($tpl, array(
+
+ $context = $context + array(
+ '$title' => t('Group Editor'),
+ '$gname' => array('groupname',t('Group Name: '),$group['name'], ''),
'$gid' => $group['id'],
- '$name' => $group['name'],
'$drop' => $drop_txt,
- '$desc' => t('Click on a contact to add or remove.'),
- '$title' => t('Group Editor'),
- '$gname' => t('Group Name: '),
- '$submit' => t('Submit')
- ));
+ );
}
if(! isset($group))
return;
- $o .= '<div id="group-update-wrapper">';
- if($change)
- $o = '';
+ $groupeditor = array(
+ 'label_members' => t('Members'),
+ 'members' => array(),
+ 'label_contacts' => t('All Contacts'),
+ 'contacts' => arraY(),
+ );
+
- $o .= '<h3>' . t('Members') . '</h3>';
- $o .= '<div id="group-members">';
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
foreach($members as $member) {
if($member['url']) {
$member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;';
- $o .= micropro($member,true,'mpgroup', $textmode);
+ $groupeditor['members'][] = micropro($member,true,'mpgroup', $textmode);
}
else
group_rmv_member(local_user(),$group['name'],$member['id']);
}
- $o .= '</div><div id="group-members-end"></div>';
- $o .= '<hr id="group-separator" />';
-
- $o .= '<h3>' . t('All Contacts') . '</h3>';
- $o .= '<div id="group-all-contacts">';
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
+ intval(local_user())
+ );
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
- intval(local_user())
- );
-
- if(count($r)) {
- $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
- foreach($r as $member) {
- if(! in_array($member['id'],$preselected)) {
- $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;';
- $o .= micropro($member,true,'mpall', $textmode);
- }
+ if(count($r)) {
+ $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
+ foreach($r as $member) {
+ if(! in_array($member['id'],$preselected)) {
+ $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;';
+ $groupeditor['contacts'][] = micropro($member,true,'mpall', $textmode);
}
}
+ }
- $o .= '</div><div id="group-all-contacts-end"></div>';
+ $context['$groupeditor'] = $groupeditor;
+ $context['$desc'] = t('Click on a contact to add or remove.');
if($change) {
- echo $o;
+ $tpl = get_markup_template('groupeditor.tpl');
+ echo replace_macros($tpl, $context);
killme();
}
- $o .= '</div>';
- return $o;
+
+ return replace_macros($tpl, $context);
}