source beautifarming to make review easier

This commit is contained in:
Alexander Kampmann 2012-04-09 16:56:01 +02:00
parent 1370ba5d16
commit 018727aa15

324
boot.php
View File

@ -109,25 +109,25 @@ define ( 'NETWORK_XMPP', 'xmpp'); // XMPP
define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace
define ( 'NETWORK_GPLUS', 'goog'); // Google+ define ( 'NETWORK_GPLUS', 'goog'); // Google+
/* /**
* These numbers are used in stored permissions * These numbers are used in stored permissions
* and existing allocations MUST NEVER BE CHANGED * and existing allocations MUST NEVER BE CHANGED
* OR RE-ASSIGNED! You may only add to them. * OR RE-ASSIGNED! You may only add to them.
*/ */
$netgroup_ids = array( $netgroup_ids = array(
NETWORK_DFRN => (-1), NETWORK_DFRN => (-1),
NETWORK_ZOT => (-2), NETWORK_ZOT => (-2),
NETWORK_OSTATUS => (-3), NETWORK_OSTATUS => (-3),
NETWORK_FEED => (-4), NETWORK_FEED => (-4),
NETWORK_DIASPORA => (-5), NETWORK_DIASPORA => (-5),
NETWORK_MAIL => (-6), NETWORK_MAIL => (-6),
NETWORK_MAIL2 => (-7), NETWORK_MAIL2 => (-7),
NETWORK_FACEBOOK => (-8), NETWORK_FACEBOOK => (-8),
NETWORK_LINKEDIN => (-9), NETWORK_LINKEDIN => (-9),
NETWORK_XMPP => (-10), NETWORK_XMPP => (-10),
NETWORK_MYSPACE => (-11), NETWORK_MYSPACE => (-11),
NETWORK_GPLUS => (-12), NETWORK_GPLUS => (-12),
); );
@ -427,67 +427,67 @@ if(! class_exists('App')) {
// if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) { // if($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) {
// if($ssl) // if($ssl)
// $scheme = 'https'; // $scheme = 'https';
// else // else
// $scheme = 'http'; // $scheme = 'http';
// } // }
}
$this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
return $this->baseurl;
}
function set_baseurl($url) {
$parsed = @parse_url($url);
$this->baseurl = $url;
if($parsed) {
$this->scheme = $parsed['scheme'];
$this->hostname = $parsed['host'];
if(x($parsed,'port'))
$this->hostname .= ':' . $parsed['port'];
if(x($parsed,'path'))
$this->path = trim($parsed['path'],'\\/');
} }
} $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
return $this->baseurl;
}
function get_hostname() { function set_baseurl($url) {
return $this->hostname; $parsed = @parse_url($url);
}
function set_hostname($h) { $this->baseurl = $url;
$this->hostname = $h;
}
function set_path($p) { if($parsed) {
$this->path = trim(trim($p),'/'); $this->scheme = $parsed['scheme'];
}
function get_path() { $this->hostname = $parsed['host'];
return $this->path; if(x($parsed,'port'))
} $this->hostname .= ':' . $parsed['port'];
if(x($parsed,'path'))
$this->path = trim($parsed['path'],'\\/');
}
function set_pager_total($n) { }
$this->pager['total'] = intval($n);
}
function set_pager_itemspage($n) { function get_hostname() {
$this->pager['itemspage'] = intval($n); return $this->hostname;
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage']; }
} function set_hostname($h) {
$this->hostname = $h;
}
function init_pagehead() { function set_path($p) {
$interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000); $this->path = trim(trim($p),'/');
if($interval < 10000) }
$interval = 40000;
$this->page['title'] = $this->config['sitename']; function get_path() {
$tpl = file_get_contents('view/head.tpl'); return $this->path;
$this->page['htmlhead'] = replace_macros($tpl,array( }
function set_pager_total($n) {
$this->pager['total'] = intval($n);
}
function set_pager_itemspage($n) {
$this->pager['itemspage'] = intval($n);
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
}
function init_pagehead() {
$interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
if($interval < 10000)
$interval = 40000;
$this->page['title'] = $this->config['sitename'];
$tpl = file_get_contents('view/head.tpl');
$this->page['htmlhead'] = replace_macros($tpl,array(
'$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!! '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$delitem' => t('Delete this item?'), '$delitem' => t('Delete this item?'),
@ -495,27 +495,27 @@ if(! class_exists('App')) {
'$showmore' => t('show more'), '$showmore' => t('show more'),
'$showfewer' => t('show fewer'), '$showfewer' => t('show fewer'),
'$update_interval' => $interval '$update_interval' => $interval
)); ));
}
function set_curl_code($code) {
$this->curl_code = $code;
}
function get_curl_code() {
return $this->curl_code;
}
function set_curl_headers($headers) {
$this->curl_headers = $headers;
}
function get_curl_headers() {
return $this->curl_headers;
}
} }
function set_curl_code($code) {
$this->curl_code = $code;
}
function get_curl_code() {
return $this->curl_code;
}
function set_curl_headers($headers) {
$this->curl_headers = $headers;
}
function get_curl_headers() {
return $this->curl_headers;
}
}
} }
// retrieve the App structure // retrieve the App structure
@ -542,7 +542,7 @@ if(! function_exists('x')) {
if($s[$k]) if($s[$k])
return (int) 1; return (int) 1;
return (int) 0; return (int) 0;
} }
return false; return false;
} }
else { else {
@ -573,7 +573,7 @@ function clean_urls() {
global $a; global $a;
// if($a->config['system']['clean_urls']) // if($a->config['system']['clean_urls'])
return true; return true;
// return false; // return false;
} }
function z_path() { function z_path() {
@ -669,10 +669,10 @@ if(! function_exists('check_config')) {
//send the administrator an e-mail //send the administrator an e-mail
$email_tpl = get_intltext_template("update_fail_eml.tpl"); $email_tpl = get_intltext_template("update_fail_eml.tpl");
$email_tpl = replace_macros($email_tpl, array( $email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'], '$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(), '$siteurl' => $a->get_baseurl(),
'$update' => $x, '$update' => $x,
'$error' => $ex->getMessage())); '$error' => $ex->getMessage()));
$subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
mail($a->config['admin_email'], $subject, $text, mail($a->config['admin_email'], $subject, $text,
@ -724,7 +724,7 @@ if(! function_exists('check_config')) {
foreach($installed as $i) { foreach($installed as $i) {
if(! in_array($i['name'],$plugins_arr)) { if(! in_array($i['name'],$plugins_arr)) {
uninstall_plugin($i['name']); uninstall_plugin($i['name']);
} }
else else
$installed_arr[] = $i['name']; $installed_arr[] = $i['name'];
} }
@ -770,8 +770,8 @@ if(! function_exists('login')) {
$reg = false; $reg = false;
if ($register) { if ($register) {
$reg = array( $reg = array(
'title' => t('Create a New Account'), 'title' => t('Create a New Account'),
'desc' => t('Register') 'desc' => t('Register')
); );
} }
@ -790,22 +790,22 @@ if(! function_exists('login')) {
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$dest_url' => $dest_url, '$dest_url' => $dest_url,
'$logout' => t('Logout'), '$logout' => t('Logout'),
'$login' => t('Login'), '$login' => t('Login'),
'$lname' => array('username', t('Nickname or Email address: ') , '', ''), '$lname' => array('username', t('Nickname or Email address: ') , '', ''),
'$lpassword' => array('password', t('Password: '), '', ''), '$lpassword' => array('password', t('Password: '), '', ''),
'$openid' => !$noid, '$openid' => !$noid,
'$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''), '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''),
'$hiddens' => $hiddens, '$hiddens' => $hiddens,
'$register' => $reg, '$register' => $reg,
'$lostpass' => t('Forgot your password?'), '$lostpass' => t('Forgot your password?'),
'$lostlink' => t('Password Reset'), '$lostlink' => t('Password Reset'),
)); ));
call_hooks('login_hook',$o); call_hooks('login_hook',$o);
@ -970,8 +970,8 @@ if(! function_exists('profile_load')) {
if(local_user() && local_user() == $a->profile['uid']) { if(local_user() && local_user() == $a->profile['uid']) {
$a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array( $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array(
'$editprofile' => t('Edit profile'), '$editprofile' => t('Edit profile'),
'$profid' => $a->profile['id'] '$profid' => $a->profile['id']
)); ));
} }
@ -1044,22 +1044,22 @@ if(! function_exists('profile_sidebar')) {
local_user()); local_user());
$profile['menu'] = array( $profile['menu'] = array(
'chg_photo' => t('Change profile photo'), 'chg_photo' => t('Change profile photo'),
'cr_new' => t('Create New Profile'), 'cr_new' => t('Create New Profile'),
'entries' => array(), 'entries' => array(),
); );
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
$profile['menu']['entries'][] = array( $profile['menu']['entries'][] = array(
'photo' => $rr['thumb'], 'photo' => $rr['thumb'],
'id' => $rr['id'], 'id' => $rr['id'],
'alt' => t('Profile Image'), 'alt' => t('Profile Image'),
'profile_name' => $rr['profile-name'], 'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'], 'isdefault' => $rr['is-default'],
'visibile_to_everybody' => t('visible to everybody'), 'visibile_to_everybody' => t('visible to everybody'),
'edit_visibility' => t('Edit visibility'), 'edit_visibility' => t('Edit visibility'),
); );
} }
@ -1096,15 +1096,15 @@ if(! function_exists('profile_sidebar')) {
$lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'],strlen($firstname)))); $lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'],strlen($firstname))));
$diaspora = array( $diaspora = array(
'podloc' => $a->get_baseurl(), 'podloc' => $a->get_baseurl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ), 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname' => $profile['nickname'], 'nickname' => $profile['nickname'],
'fullname' => $profile['name'], 'fullname' => $profile['name'],
'firstname' => $firstname, 'firstname' => $firstname,
'lastname' => $lastname, 'lastname' => $lastname,
'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg', 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg', 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg', 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
); );
if (!$block){ if (!$block){
@ -1115,16 +1115,16 @@ if(! function_exists('profile_sidebar')) {
$tpl = get_markup_template('profile_vcard.tpl'); $tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$profile' => $profile, '$profile' => $profile,
'$connect' => $connect, '$connect' => $connect,
'$wallmessage' => $wallmessage, '$wallmessage' => $wallmessage,
'$location' => template_escape($location), '$location' => template_escape($location),
'$gender' => $gender, '$gender' => $gender,
'$pdesc' => $pdesc, '$pdesc' => $pdesc,
'$marital' => $marital, '$marital' => $marital,
'$homepage' => $homepage, '$homepage' => $homepage,
'$diaspora' => $diaspora, '$diaspora' => $diaspora,
'$contact_block' => $contact_block, '$contact_block' => $contact_block,
)); ));
@ -1324,7 +1324,7 @@ if(! function_exists('current_theme')) {
foreach($app_base_themes as $t) { foreach($app_base_themes as $t) {
if(file_exists('view/theme/' . $t . '/style.css')|| if(file_exists('view/theme/' . $t . '/style.css')||
file_exists('view/theme/' . $t . '/style.php')) file_exists('view/theme/' . $t . '/style.php'))
return($t); return($t);
} }
@ -1447,34 +1447,34 @@ if(! function_exists('profile_tabs')){
$url = $a->get_baseurl() . '/profile/' . $nickname; $url = $a->get_baseurl() . '/profile/' . $nickname;
$tabs = array( $tabs = array(
array( array(
'label'=>t('Status'), 'label'=>t('Status'),
'url' => $url, 'url' => $url,
'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''), 'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''),
), ),
array( array(
'label' => t('Profile'), 'label' => t('Profile'),
'url' => $url.'/?tab=profile', 'url' => $url.'/?tab=profile',
'sel' => ((isset($tab) && $tab=='profile')?'active':''), 'sel' => ((isset($tab) && $tab=='profile')?'active':''),
), ),
array( array(
'label' => t('Photos'), 'label' => t('Photos'),
'url' => $a->get_baseurl() . '/photos/' . $nickname, 'url' => $a->get_baseurl() . '/photos/' . $nickname,
'sel' => ((!isset($tab)&&$a->argv[0]=='photos')?'active':''), 'sel' => ((!isset($tab)&&$a->argv[0]=='photos')?'active':''),
), ),
); );
if ($is_owner){ if ($is_owner){
$tabs[] = array( $tabs[] = array(
'label' => t('Events'), 'label' => t('Events'),
'url' => $a->get_baseurl() . '/events', 'url' => $a->get_baseurl() . '/events',
'sel' =>((!isset($tab)&&$a->argv[0]=='events')?'active':''), 'sel' =>((!isset($tab)&&$a->argv[0]=='events')?'active':''),
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Personal Notes'), 'label' => t('Personal Notes'),
'url' => $a->get_baseurl() . '/notes', 'url' => $a->get_baseurl() . '/notes',
'sel' =>((!isset($tab)&&$a->argv[0]=='notes')?'active':''), 'sel' =>((!isset($tab)&&$a->argv[0]=='notes')?'active':''),
); );
} }