]> git.mxchange.org Git - friendica.git/blob - mod/settings.php
common_tabs in notifications.php
[friendica.git] / mod / settings.php
1 <?php
2
3
4 function settings_init(&$a) {
5         if(local_user()) {
6                 profile_load($a,$a->user['nickname']);
7         }
8
9         $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
10
11         $a->page['htmlhead'] .= <<< EOT
12
13         $(document).ready(function() {
14
15                 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
16                         var selstr;
17                         $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
18                                 selstr = $(this).text();
19                                 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
20                                 $('#jot-public').hide();
21                         });
22                         if(selstr == null) { 
23                                 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
24                                 $('#jot-public').show();
25                         }
26
27                 }).trigger('change');
28
29         });
30
31         </script>
32 EOT;
33
34
35 }
36
37
38 function settings_post(&$a) {
39
40         if(! local_user()) {
41                 notice( t('Permission denied.') . EOL);
42                 return;
43         }
44
45         if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
46                 notice( t('Permission denied.') . EOL);
47                 return;
48         }
49
50         if(($a->argc > 1) && ($a->argv[1] == 'addon')) {
51                 call_hooks('plugin_settings_post', $_POST);
52                 return;
53         }
54
55         call_hooks('settings_post', $_POST);
56
57         if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {
58
59                 $newpass = $_POST['npassword'];
60                 $confirm = $_POST['confirm'];
61
62                 $err = false;
63                 if($newpass != $confirm ) {
64                         notice( t('Passwords do not match. Password unchanged.') . EOL);
65                         $err = true;
66                 }
67
68                 if((! x($newpass)) || (! x($confirm))) {
69                         notice( t('Empty passwords are not allowed. Password unchanged.') . EOL);
70                         $err = true;
71                 }
72
73                 if(! $err) {
74                         $password = hash('whirlpool',$newpass);
75                         $r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1",
76                                 dbesc($password),
77                                 intval(local_user())
78                         );
79                         if($r)
80                                 info( t('Password changed.') . EOL);
81                         else
82                                 notice( t('Password update failed. Please try again.') . EOL);
83                 }
84         }
85
86         $theme            = ((x($_POST,'theme'))      ? notags(trim($_POST['theme']))        : '');
87         $username         = ((x($_POST,'username'))   ? notags(trim($_POST['username']))     : '');
88         $email            = ((x($_POST,'email'))      ? notags(trim($_POST['email']))        : '');
89         $timezone         = ((x($_POST,'timezone'))   ? notags(trim($_POST['timezone']))     : '');
90         $defloc           = ((x($_POST,'defloc'))     ? notags(trim($_POST['defloc']))       : '');
91         $openid           = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url']))   : '');
92         $maxreq           = ((x($_POST,'maxreq'))     ? intval($_POST['maxreq'])             : 0);
93         $expire           = ((x($_POST,'expire'))     ? intval($_POST['expire'])             : 0);
94
95         $allow_location   = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
96         $publish          = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
97         $net_publish      = (((x($_POST,'profile_in_netdirectory')) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0);
98         $old_visibility   = (((x($_POST,'visibility')) && (intval($_POST['visibility']) == 1)) ? 1 : 0);
99         $page_flags       = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
100         $blockwall        = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
101
102         $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
103         $hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
104
105
106
107
108         $mail_server      = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
109         $mail_port        = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
110         $mail_ssl         = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
111         $mail_user        = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : '');
112         $mail_pass        = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : '');
113         $mail_replyto     = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : '');
114         $mail_pubmail     = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
115
116
117         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
118         if(get_config('system','dfrn_only'))
119                 $mail_disabled = 1;
120
121         if(! $mail_disabled) {
122                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
123                         intval(local_user())
124                 );
125                 if(! count($r)) {
126                         q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
127                                 intval(local_user())
128                         );
129                 }
130                 if(strlen($mail_pass)) {
131                         $pass = '';
132                         openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
133                         q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d LIMIT 1",
134                                         dbesc(bin2hex($pass)),
135                                         intval(local_user())
136                         );
137                 }
138                 $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
139                         `mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1",
140                         dbesc($mail_server),
141                         intval($mail_port),
142                         dbesc($mail_ssl),
143                         dbesc($mail_user),
144                         dbesc($mail_replyto),
145                         intval($mail_pubmail),
146                         intval(local_user())
147                 );
148                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
149                         intval(local_user())
150                 );
151                 if(count($r)) {
152                         $eacct = $r[0];
153                         require_once('include/email.php');
154                         $mb = construct_mailbox_name($eacct);
155                         if(strlen($eacct['server'])) {
156                                 $dcrpass = '';
157                                 openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
158                                 $mbox = email_connect($mb,$mail_user,$dcrpass);
159                                 unset($dcrpass);
160                                 if(! $mbox)
161                                         notice( t('Failed to connect with email account using the settings provided.') . EOL);
162                         }
163                 }
164         }
165
166         $notify = 0;
167
168         if(x($_POST,'notify1'))
169                 $notify += intval($_POST['notify1']);
170         if(x($_POST,'notify2'))
171                 $notify += intval($_POST['notify2']);
172         if(x($_POST,'notify3'))
173                 $notify += intval($_POST['notify3']);
174         if(x($_POST,'notify4'))
175                 $notify += intval($_POST['notify4']);
176         if(x($_POST,'notify5'))
177                 $notify += intval($_POST['notify5']);
178
179         $email_changed = false;
180
181         $err = '';
182
183         $name_change = false;
184
185         if($username != $a->user['username']) {
186                 $name_change = true;
187                 if(strlen($username) > 40)
188                         $err .= t(' Please use a shorter name.');
189                 if(strlen($username) < 3)
190                         $err .= t(' Name too short.');
191         }
192
193         if($email != $a->user['email']) {
194                 $email_changed = true;
195         if(! valid_email($email))
196                         $err .= t(' Not valid email.');
197                 if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) {
198                         $err .= t(' Cannot change to that email.');
199                         $email = $a->user['email'];
200                 }
201         }
202
203         if(strlen($err)) {
204                 notice($err . EOL);
205                 return;
206         }
207
208         if($timezone != $a->user['timezone']) {
209                 if(strlen($timezone))
210                         date_default_timezone_set($timezone);
211         }
212
213         $str_group_allow   = perms2str($_POST['group_allow']);
214         $str_contact_allow = perms2str($_POST['contact_allow']);
215         $str_group_deny    = perms2str($_POST['group_deny']);
216         $str_contact_deny  = perms2str($_POST['contact_deny']);
217
218         $openidserver = $a->user['openidserver'];
219
220         // If openid has changed or if there's an openid but no openidserver, try and discover it.
221
222         if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) {
223                 $tmp_str = $openid;
224                 if(strlen($tmp_str) && validate_url($tmp_str)) {
225                         logger('updating openidserver');
226                         require_once('library/openid.php');
227                         $open_id_obj = new LightOpenID;
228                         $open_id_obj->identity = $openid;
229                         $openidserver = $open_id_obj->discover($open_id_obj->identity);
230                 }
231                 else
232                         $openidserver = '';
233         }
234
235         $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d  WHERE `uid` = %d LIMIT 1",
236                         dbesc($username),
237                         dbesc($email),
238                         dbesc($openid),
239                         dbesc($timezone),
240                         dbesc($str_contact_allow),
241                         dbesc($str_group_allow),
242                         dbesc($str_contact_deny),
243                         dbesc($str_group_deny),
244                         intval($notify),
245                         intval($page_flags),
246                         dbesc($defloc),
247                         intval($allow_location),
248                         dbesc($theme),
249                         intval($maxreq),
250                         intval($expire),
251                         dbesc($openidserver),
252                         intval($blockwall),
253                         intval($hidewall),
254                         intval(local_user())
255         );
256         if($r)
257                 info( t('Settings updated.') . EOL);
258
259         $r = q("UPDATE `profile` 
260                 SET `publish` = %d, 
261                 `net-publish` = %d,
262                 `hide-friends` = %d
263                 WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
264                 intval($publish),
265                 intval($net_publish),
266                 intval($hide_friends),
267                 intval(local_user())
268         );
269
270
271         if($name_change) {
272                 q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self` = 1 LIMIT 1",
273                         dbesc($username),
274                         dbesc(datetime_convert()),
275                         intval(local_user())
276                 );
277         }               
278
279         if($old_visibility != $net_publish) {
280                 // Update global directory in background
281                 $url = $_SESSION['my_url'];
282                 if($url && strlen(get_config('system','directory_submit_url')))
283                         proc_run('php',"include/directory.php","$url");
284         }
285
286         $_SESSION['theme'] = $theme;
287         if($email_changed && $a->config['register_policy'] == REGISTER_VERIFY) {
288
289                 // FIXME - set to un-verified, blocked and redirect to logout
290
291         }
292
293         goaway($a->get_baseurl() . '/settings' );
294         return; // NOTREACHED
295 }
296                 
297
298 if(! function_exists('settings_content')) {
299 function settings_content(&$a) {
300
301         $o = '';
302         nav_set_selected('settings');
303
304         if(! local_user()) {
305                 notice( t('Permission denied.') . EOL );
306                 return;
307         }
308         
309         $tabs = array(
310                 array(
311                         'label' => t('Account settings'),
312                         'url'   => $a->get_baseurl().'/settings',
313                         'sel'   => (($a->argc == 1)?'active':''),
314                 ),      
315                 array(
316                         'label' => t('Plugin settings'),
317                         'url'   => $a->get_baseurl().'/settings/addon',
318                         'sel'   => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
319                 )
320         );
321         
322         $tabtpl = get_markup_template("common_tabs.tpl");
323         $tabs = replace_macros($tabtpl, array(
324                 '$tabs' => $tabs,
325         ));
326                 
327         
328
329         if(($a->argc > 1) && ($a->argv[1] === 'addon')) {
330                 $settings_addons = "";
331                 
332                 $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
333                 if(! count($r))
334                         $settings_addons = t('No Plugin settings configured');
335
336                 call_hooks('plugin_settings', $settings_addons);
337                 
338                 
339                 $tpl = get_markup_template("settings_addons.tpl");
340                 $o .= replace_macros($tpl, array(
341                         '$title'        => t('Plugin Settings'),
342                         '$tabs'         => $tabs,
343                         '$settings_addons' => $settings_addons
344                 ));
345                 return $o;
346         }
347                 
348         require_once('include/acl_selectors.php');
349
350         $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
351                 intval(local_user())
352         );
353         if(count($p))
354                 $profile = $p[0];
355
356         $username = $a->user['username'];
357         $email    = $a->user['email'];
358         $nickname = $a->user['nickname'];
359         $timezone = $a->user['timezone'];
360         $notify   = $a->user['notify-flags'];
361         $defloc   = $a->user['default-location'];
362         $openid   = $a->user['openid'];
363         $maxreq   = $a->user['maxreq'];
364         $expire   = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
365         $blockwall = $a->user['blockwall'];
366
367         if(! strlen($a->user['timezone']))
368                 $timezone = date_default_timezone_get();
369
370
371         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
372         if(get_config('system','dfrn_only'))
373                 $mail_disabled = 1;
374
375         if(! $mail_disabled) {
376                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
377                         local_user()
378                 );
379         }
380         else {
381                 $r = null;
382         }
383
384         $mail_server  = ((count($r)) ? $r[0]['server'] : '');
385         $mail_port    = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
386         $mail_ssl     = ((count($r)) ? $r[0]['ssltype'] : '');
387         $mail_user    = ((count($r)) ? $r[0]['user'] : '');
388         $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
389         $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
390         $mail_chk     = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
391
392         $pageset_tpl = get_markup_template('pagetypes.tpl');
393         $pagetype = replace_macros($pageset_tpl,array(
394                 '$page_normal'  => array('page-flags', t('Normal Account'), PAGE_NORMAL, 
395                                                                         t('This account is a normal personal profile'), 
396                                                                         ($a->user['page-flags'] == PAGE_NORMAL)),
397                                                                 
398                 '$page_soapbox'         => array('page-flags', t('Soapbox Account'), PAGE_SOAPBOX, 
399                                                                         t('Automatically approve all connection/friend requests as read-only fans'), 
400                                                                         ($a->user['page-flags'] == PAGE_SOAPBOX)),
401                                                                         
402                 '$page_community'       => array('page-flags', t('Community/Celebrity Account'), PAGE_COMMUNITY, 
403                                                                         t('Automatically approve all connection/friend requests as read-write fans'), 
404                                                                         ($a->user['page-flags'] == PAGE_COMMUNITY)),
405                                                                         
406                 '$page_freelove'        => array('page-flags', t('Automatic Friend Account'), PAGE_FREELOVE, 
407                                                                         t('Automatically approve all connection/friend requests as friends'), 
408                                                                         ($a->user['page-flags'] == PAGE_FREELOVE)),
409         ));
410
411         $noid = get_config('system','no_openid');
412
413         if($noid) {
414                 $openid_field = false;
415         }
416         else {
417                 $openid_field = array('openid_url', t('OpenID:'),$openid, t("\x28Optional\x29 Allow this OpenID to login to this account."));
418         }
419
420
421         $opt_tpl = get_markup_template("field_yesno.tpl");
422         if(get_config('system','publish_all')) {
423                 $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
424         }
425         else {
426                 $profile_in_dir = replace_macros($opt_tpl,array(
427                         '$field'        => array('profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], '', array(t('No'),t('Yes'))),
428                 ));
429         }
430
431         if(strlen(get_config('system','directory_submit_url'))) {
432                 $profile_in_net_dir = replace_macros($opt_tpl,array(
433                         '$field'        => array('profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', array(t('No'),t('Yes'))),
434                 ));
435         }
436         else
437                 $profile_in_net_dir = '';
438
439
440         $hide_friends = replace_macros($opt_tpl,array(
441                         '$field'        => array('hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', array(t('No'),t('Yes'))),
442         ));
443
444         $hide_wall = replace_macros($opt_tpl,array(
445                         '$field'        => array('hidewall',  t('Hide profile details and all your messages from unknown viewers?'), $a->user['hidewall'], '', array(t('No'),t('Yes'))),
446
447         ));
448
449
450         $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
451                 ? true : false);
452
453         if($invisible)
454                 info( t('Profile is <strong>not published</strong>.') . EOL );
455
456         
457         $default_theme = get_config('system','theme');
458         if(! $default_theme)
459                 $default_theme = 'default';
460         
461         $themes = array();
462         $files = glob('view/theme/*');
463         if($files) {
464                 foreach($files as $file) {
465                         $f = basename($file);
466                         $theme_name = ((file_exists($file . '/experimental')) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
467                         $themes[$f]=$theme_name;
468                 }
469         }
470         $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
471
472
473         $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : '');
474
475         $tpl_addr = get_markup_template("settings_nick_set.tpl");
476
477         $prof_addr = replace_macros($tpl_addr,array(
478                 '$desc' => t('Your Identity Address is'),
479                 '$nickname' => $nickname,
480                 '$subdir' => $subdir,
481                 '$basepath' => $a->get_hostname()
482         ));
483
484         $stpl = get_markup_template('settings.tpl');
485
486         $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
487
488         
489
490         $o .= replace_macros($stpl,array(
491                 '$tabs'         => $tabs,
492                 '$ptitle'       => t('Account Settings'),
493
494                 '$submit'       => t('Submit'),
495                 '$baseurl' => $a->get_baseurl(),
496                 '$uid' => local_user(),
497                 
498                 '$nickname_block' => $prof_addr,
499                 '$uexport' => t('Export Personal Data'),
500                 
501                 
502                 '$h_pass'       => t('Password Settings'),
503                 '$password1'=> array('npassword', t('New Password:'), '', ''),
504                 '$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')),
505                 '$oid_enable' => (! get_config('system','no_openid')),
506                 '$openid'       => $openid_field,
507                 
508                 '$h_basic'      => t('Basic Settings'),
509                 '$username' => array('username',  t('Full Name:'), $username,''),
510                 '$email'        => array('email', t('Email Address:'), $email, ''),
511                 '$timezone' => array('timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''),
512                 '$defloc'       => array('defloc', t('Default Post Location:'), $defloc, ''),
513                 '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
514                 '$theme'        => array('theme', t('Display Theme:'), $theme_selected, '', $themes),
515
516
517
518                 '$h_prv'        => t('Security and Privacy Settings'),
519
520                 '$maxreq'       => array('maxreq', t('Maximum Friend Requests/Day:'), $maxreq ,t("\x28to prevent spam abuse\x29")),
521                 '$permissions' => t('Default Post Permissions'),
522                 '$permdesc' => t("\x28click to open/close\x29"),
523                 '$visibility' => $profile['net-publish'],
524                 '$aclselect' => populate_acl($a->user,$celeb),
525
526                 '$blockwall'=> array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
527                 '$expire'       => array('expire', t("Automatically expire posts after days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
528
529                 '$profile_in_dir' => $profile_in_dir,
530                 '$profile_in_net_dir' => $profile_in_net_dir,
531                 '$hide_friends' => $hide_friends,
532                 '$hide_wall' => $hide_wall,
533                 
534                 
535                 
536                 '$h_not'        => t('Notification Settings'),
537                 '$lbl_not'      => t('Send a notification email when:'),
538                 '$notify1'      => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
539                 '$notify2'      => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),
540                 '$notify3'      => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''),
541                 '$notify4'      => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''),
542                 '$notify5'      => array('notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''),
543                 
544                 
545                 
546                 '$h_imap' => t('Email/Mailbox Setup'),
547                 '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
548                 '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $imap_last_check,''),
549                 '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''),
550                 '$mail_server'  => array('mail_server',  t('IMAP server name:'), $mail_server, ''),
551                 '$mail_port'    => array('mail_port',    t('IMAP port:'), $mail_port, ''),
552                 '$mail_ssl'             => array('mail_ssl',     t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TSL'=>'TSL', 'SSL'=>'SSL')),
553                 '$mail_user'    => array('mail_user',    t('Email login name:'), $mail_user, ''),
554                 '$mail_pass'    => array('mail_pass',    t('Email password:'), '', ''),
555                 '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'),
556                 '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
557                 
558                 
559                 
560                 
561                 '$h_advn' => t('Advanced Page Settings'),
562                 '$pagetype' => $pagetype,
563                 
564
565                 
566                 
567
568                 
569
570
571
572
573                 
574
575         ));
576
577         call_hooks('settings_form',$o);
578
579         $o .= '</form>' . "\r\n";
580
581         return $o;
582
583 }}
584