]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
works on login form
[friendica.git] / boot.php
index fb406867d804275f50162efc34a8d6cd4da940db..e7cd065044590037799033360844b844822b6a52 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -8,9 +8,9 @@ require_once("include/pgettext.php");
 require_once('include/nav.php');
 
 define ( 'FRIENDIKA_PLATFORM',     'Free Friendika');
-define ( 'FRIENDIKA_VERSION',      '2.3.1132' );
+define ( 'FRIENDIKA_VERSION',      '2.3.1134' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1095      );
+define ( 'DB_UPDATE_VERSION',      1097      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -636,29 +636,16 @@ function get_guid($size=16) {
 if(! function_exists('login')) {
 function login($register = false) {
        $o = "";
-       $register_tpl = (($register) ? get_markup_template("register-link.tpl") : "");
-       
-       $register_html = replace_macros($register_tpl,array(
-               '$title' => t('Create a New Account'),
-               '$desc' => t('Register')
-       ));
-
-       $noid = get_config('system','no_openid');
-       if($noid) {
-               $classname = 'no-openid';
-               $namelabel = t('Nickname or Email address: ');
-               $passlabel = t('Password: ');
-               $login     = t('Login');
-       }
-       else {
-               $classname = 'openid';
-               $namelabel = t('Nickname/Email/OpenID: ');
-               $passlabel = t("Password \x28if not OpenID\x29: ");
-               $login     = t('Login');
+       $reg = false;
+       if ($register) {
+               $reg = array(
+                       'title' => t('Create a New Account'),
+                       'desc' => t('Register')
+               );
        }
-       $lostpass = t('Forgot your password?');
-       $lostlink = t('Password Reset');
 
+       $noid = get_config('system','no_openid');
+       
        if(local_user()) {
                $tpl = get_markup_template("logout.tpl");
        }
@@ -667,17 +654,22 @@ function login($register = false) {
 
        }
 
-       $o = '<script type="text/javascript"> $(document).ready(function() { $("#login-name").focus();} );</script>';   
 
        $o .= replace_macros($tpl,array(
                '$logout'        => t('Logout'),
-               '$register_html' => $register_html, 
-               '$classname'     => $classname,
-               '$namelabel'     => $namelabel,
-               '$passlabel'     => $passlabel,
-               '$login'         => $login,
-               '$lostpass'      => $lostpass,
-               '$lostlink'      => $lostlink 
+               '$login'                 => t('Login'),
+               
+               '$lname'                => array('username', t('Nickname or Email address: ') , '', ''),
+               '$lpassword'    => array('password', t('Password: '), '', ''),
+               
+               '$openid'               => !$noid,
+               '$lopenid'      => array('openid_url', t('OpenID: '),'',''),
+               
+               
+               '$register'             => $reg,
+               
+               '$lostpass'      => t('Forgot your password?'),
+               '$lostlink'      => t('Password Reset'),
        ));
 
        call_hooks('login_hook',$o);
@@ -974,6 +966,7 @@ function get_birthdays() {
                return $o;
 
        $bd_format = t('g A l F d') ; // 8 AM Friday January 18
+       $bd_short = t('F d');
 
        $r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event` 
                LEFT JOIN `contact` ON `contact`.`id` = `event`.`cid` 
@@ -993,7 +986,7 @@ function get_birthdays() {
                if($total) {
                        $o .= '<div id="birthday-notice" class="birthday-notice fakelink" onclick=openClose(\'birthday-wrapper\'); >' . t('Birthday Reminders') . ' ' . '(' . $total . ')' . '</div>'; 
                        $o .= '<div id="birthday-wrapper" style="display: none;" ><div id="birthday-title">' . t('Birthdays this week:') . '</div>'; 
-                       $o .= '<div id="birthday-adjust">' . t("\x28Adjusted for local time\x29") . '</div>';
+//                     $o .= '<div id="birthday-adjust">' . t("\x28Adjusted for local time\x29") . '</div>';
                        $o .= '<div id="birthday-title-end"></div>';
 
                        foreach($r as $rr) {
@@ -1001,10 +994,16 @@ function get_birthdays() {
                                        continue;
                                $now = strtotime('now');
                                $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); 
+                               $sparkle = '';
+                               $url = $rr['url'];
+                               if($rr['network'] === NETWORK_DFRN) {
+                                       $sparkle = " sparkle";
+                                       $url = $a->get_baseurl() . '/redir/'  . $rr['cid'];
+                               }
        
-                               $o .= '<div class="birthday-list" id="birthday-' . $rr['eid'] . '"><a class="sparkle" target="redir" href="' 
-                               . $a->get_baseurl() . '/redir/'  . $rr['cid'] . '">' . $rr['name'] . '</a> ' 
-                               . day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $bd_format)) . (($today) ?  ' ' . t('[today]') : '')
+                               $o .= '<div class="birthday-list" id="birthday-' . $rr['eid'] . '"><a class="birthday-link$sparkle" target="redir" href="' 
+                               . $url . '">' . $rr['name'] . '</a> ' 
+                               . day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ?  ' ' . t('[today]') : '')
                                . '</div>' ;
                        }
                        $o .= '</div></div>';