]> git.mxchange.org Git - friendica.git/blobdiff - mod/manage.php
Statusnet is now GNU Social
[friendica.git] / mod / manage.php
old mode 100755 (executable)
new mode 100644 (file)
index 84dfa69..5513ebe
@@ -1,5 +1,7 @@
 <?php
 
+require_once("include/text.php");
+
 
 function manage_post(&$a) {
 
@@ -63,10 +65,15 @@ function manage_post(&$a) {
        unset($_SESSION['administrator']);
        unset($_SESSION['cid']);
        unset($_SESSION['theme']);
+       unset($_SESSION['mobile-theme']);
        unset($_SESSION['page_flags']);
        unset($_SESSION['return_url']);
        if(x($_SESSION,'submanage'))
                unset($_SESSION['submanage']);
+       if(x($_SESSION,'sysmsg'))
+               unset($_SESSION['sysmsg']);
+       if(x($_SESSION,'sysmsg_info'))
+               unset($_SESSION['sysmsg_info']);
 
        require_once('include/security.php');
        authenticate_success($r[0],true,true);
@@ -74,7 +81,10 @@ function manage_post(&$a) {
        if($limited_id)
                $_SESSION['submanage'] = $original_id;
 
-       goaway($a->get_baseurl(true) . '/profile/' . $a->user['nickname']);
+       $ret = array();
+       call_hooks('home_init',$ret);
+
+       goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] );
        // NOTREACHED
 }
 
@@ -87,26 +97,18 @@ function manage_content(&$a) {
                return;
        }
 
-       $o = '<h3>' . t('Manage Identities and/or Pages') . '</h3>';
-
-       
-       $o .= '<div id="identity-manage-desc">' . t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions') . '</div>';
-
-       $o .= '<div id="identity-manage-choose">' . t('Select an identity to manage: ') . '</div>';
-
-       $o .= '<div id="identity-selector-wrapper">' . "\r\n";
-       $o .= '<form action="manage" method="post" >' . "\r\n";
-       $o .= '<select name="identity" size="4">' . "\r\n";
-
-       foreach($a->identities as $rr) {
-               $selected = (($rr['nickname'] === $a->user['nickname']) ? ' selected="selected" ' : '');
-               $o .= '<option ' . $selected . 'value="' . $rr['uid'] . '">' . $rr['username'] . ' (' . $rr['nickname'] . ')</option>' . "\r\n";
+       $identities = $a->identities;
+       foreach($identities as $key=>$id) {
+               $identities[$key]['selected'] = (($id['nickname'] === $a->user['nickname']) ? ' selected="selected" ' : '');
        }
 
-       $o .= '</select>' . "\r\n";
-       $o .= '<div id="identity-select-break"></div>' . "\r\n";
-
-       $o .= '<input id="identity-submit" type="submit" name="submit" value="' . t('Submit') . '" /></div></form>' . "\r\n";
+       $o = replace_macros(get_markup_template('manage.tpl'), array(
+               '$title' => t('Manage Identities and/or Pages'),
+               '$desc' => t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
+               '$choose' => t('Select an identity to manage: '),
+               '$identities' => $identities,
+               '$submit' => t('Submit'),
+       ));
 
        return $o;