/** * Get available group permissions * * @return array */ function get_available_group_permissions($grp_ID = NULL) { global $Settings; $none_option = array('none', T_('No Access'), ''); $view_option = array('view', T_('View only'), ''); $moderate_option = array('moderate', T_('Moderate'), ''); $full_option = array('edit', T_('Full Access'), ''); $view_details = array('view', T_('View details')); $edit_option = array('edit', T_('Edit/delete all')); // 'label' is used in the group form as label for radio buttons group // 'user_func' function used to check user permission. This function should be defined in Module. // 'group_func' function used to check group permission. This function should be defined in Module. // 'perm_block' group form block where this permissions will be displayed. Now available, the following blocks: additional, system // 'options' is permission options // 'perm_type' is used in the group form to decide to show radiobox or checkbox // 'field_lines' is used in the group form to decide to show radio options in multiple lines or not if ($grp_ID == 1) { $perm_admin_values = array('label' => T_('Access to Admin area'), 'perm_block' => 'core_general', 'perm_type' => 'info', 'info' => T_('Visible link')); $perm_users_values = array('label' => T_('Users & Groups'), 'perm_block' => 'core', 'perm_type' => 'info', 'info' => T_('Full Access') . get_admin_badge('user', '#', '#', T_('This group has User Admin permission.'))); } else { $perm_admin_values = array('label' => T_('Access to Admin area'), 'user_func' => 'check_admin_user_perm', 'group_func' => 'check_admin_group_perm', 'perm_block' => 'core_general', 'options' => array(array('no_toolbar', T_('No Toolbar')), $none_option, array('restricted', T_('Restricted')), array('normal', T_('Normal'))), 'perm_type' => 'radiobox', 'field_lines' => false); $user_edit_option = $edit_option; $user_edit_option[1] .= get_admin_badge('user', '#', '#', T_('Select to give User Admin permission')); $perm_users_values = array('label' => T_('Users & Groups'), 'user_func' => 'check_core_user_perm', 'group_func' => 'check_core_group_perm', 'perm_block' => 'core', 'options' => array($none_option, $view_details, $moderate_option, $user_edit_option), 'perm_type' => 'radiobox', 'field_lines' => false); } $notification_options = array(array('short', T_('Short')), array('full', T_('Full text'))); $notifications_array = array('group_func' => 'check_notification', 'perm_block' => 'notifications', 'options' => $notification_options, 'perm_type' => 'radiobox', 'field_note' => T_('Selecting "Full text" may generate email containing unwanted spam.'), 'field_lines' => false); // Set additional note for cross country users restriction, if anonymous users can see the users list or users profiles $cross_country_note = ''; if ($Settings->get('allow_anonymous_user_list') || $Settings->get('allow_anonymous_user_profiles')) { $cross_country_note = ' <span class="warning">' . T_('Browsing / Viewing users is currently allowed for anonymous users') . '</span>'; } $permissions = array('perm_admin' => $perm_admin_values, 'perm_users' => $perm_users_values, 'perm_options' => array('label' => T_('Settings'), 'user_func' => 'check_core_user_perm', 'group_func' => 'check_core_group_perm', 'perm_block' => 'core', 'options' => array($none_option, $view_details, $edit_option), 'perm_type' => 'radiobox', 'field_lines' => false), 'perm_spamblacklist' => array('label' => T_('Antispam'), 'user_func' => 'check_core_user_perm', 'group_func' => 'check_core_group_perm', 'perm_block' => 'core2', 'options' => array($none_option, $view_option, $full_option), 'perm_type' => 'radiobox', 'field_lines' => false), 'perm_slugs' => array('label' => T_('Slug manager'), 'user_func' => 'check_core_user_perm', 'group_func' => 'check_core_group_perm', 'perm_block' => 'core2', 'options' => array($none_option, $view_option, $full_option), 'perm_type' => 'radiobox', 'field_lines' => false), 'perm_emails' => array('label' => T_('Email management'), 'user_func' => 'check_core_user_perm', 'group_func' => 'check_core_group_perm', 'perm_block' => 'core2', 'options' => array($none_option, $view_details, $edit_option), 'perm_type' => 'radiobox', 'field_lines' => false), 'perm_templates' => array('label' => T_('Skins'), 'user_func' => 'check_template_user_perm', 'group_func' => 'check_template_group_perm', 'perm_block' => 'core3', 'perm_type' => 'checkbox', 'note' => T_('Check to allow access to skin files.')), 'pm_notif' => array_merge(array('label' => T_('New Private Message notifications')), $notifications_array), 'comment_subscription_notif' => array_merge(array('label' => T_('New Comment subscription notifications')), $notifications_array), 'comment_moderation_notif' => array_merge(array('label' => T_('New Comment moderation notifications')), $notifications_array), 'post_subscription_notif' => array_merge(array('label' => T_('New Post subscription notifications')), $notifications_array), 'post_moderation_notif' => array_merge(array('label' => T_('New Post moderation notifications')), $notifications_array), 'cross_country_allow_profiles' => array('label' => T_('Users'), 'user_func' => 'check_cross_country_user_perm', 'group_func' => 'check_cross_country_group_perm', 'perm_block' => 'additional', 'perm_type' => 'checkbox', 'note' => T_('Allow to browse users from other countries') . $cross_country_note), 'cross_country_allow_contact' => array('label' => T_('Messages'), 'user_func' => 'check_cross_country_user_perm', 'group_func' => 'check_cross_country_group_perm', 'perm_block' => 'additional', 'perm_type' => 'checkbox', 'note' => T_('Allow to contact users from other countries'))); return $permissions; }
* Colmun definitions: */ $Results->cols[] = array('th' => T_('ID'), 'order' => 'grp_ID', 'td' => '$grp_ID$', 'th_class' => 'shrinkwrap', 'td_class' => 'right'); $Results->cols[] = array('th' => T_('Group'), 'order' => 'grp_name', 'td' => '<a href="?ctrl=users&filter=new&group=$grp_ID$">$grp_name$ ($grp_level$)</a>'); $Results->cols[] = array('th' => sprintf(T_('Member of<br />%s'), $Blog->get('shortname')), 'th_class' => 'checkright', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'ismember\', \'' . format_to_output(T_('Permission to read members posts'), 'htmlattr') . '\', \'checkallspan_state_$grp_ID$\' )%' . ($edited_Blog->get_setting('use_workflow') ? '%coll_perm_checkbox( {row}, \'bloggroup_\', \'can_be_assignee\', \'' . format_to_output(T_('Items can be assigned to members of this group'), 'htmlattr') . '\', \'checkallspan_state_$grp_ID$\' )%' : ''), 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Posts'), 'th' => T_('Post Statuses'), 'th_class' => 'checkright', 'td' => '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'published\', \'' . format_to_output(T_('Permission to post into this blog with published status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'community\', \'' . format_to_output(T_('Permission to post into this blog with community status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'protected\', \'' . format_to_output(T_('Permission to post into this blog with members status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'review\', \'' . format_to_output(T_('Permission to post into this blog with review status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'private\', \'' . format_to_output(T_('Permission to post into this blog with private status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'draft\', \'' . format_to_output(T_('Permission to post into this blog with draft status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'deprecated\', \'' . format_to_output(T_('Permission to post into this blog with deprecated status'), 'htmlattr') . '\', \'post\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'redirected\', \'' . format_to_output(T_('Permission to post into this blog with redirected status'), 'htmlattr') . '\', \'post\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Posts'), 'th' => T_('Post Types'), 'th_class' => 'checkright', 'td' => '%coll_perm_item_type( {row}, \'bloggroup_\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Posts'), 'th' => T_('Edit posts<br />/user level'), 'th_class' => 'checkright', 'default_dir' => 'D', 'td' => '%coll_perm_edit( {row}, \'bloggroup_\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Posts'), 'th' => T_('Delete<br />posts'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_delpost', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_delpost\', \'' . format_to_output(T_('Permission to delete posts in this blog'), 'htmlattr') . '\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Posts'), 'th' => T_('Edit<br />TS'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_edit_ts', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_edit_ts\', \'' . format_to_output(T_('Permission to edit timestamp on posts and comments in this blog'), 'htmlattr') . '\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Comments'), 'th' => T_('Comment<br />statuses'), 'th_class' => 'checkright', 'td' => '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'published\', \'' . format_to_output(T_('Permission to comment into this blog with published status'), 'htmlattr') . '\', \'comment\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'community\', \'' . format_to_output(T_('Permission to comment into this blog with community status'), 'htmlattr') . '\', \'comment\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'protected\', \'' . format_to_output(T_('Permission to comment into this blog with members status'), 'htmlattr') . '\', \'comment\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'review\', \'' . format_to_output(T_('Permission to comment into this blog with review status'), 'htmlattr') . '\', \'comment\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'private\', \'' . format_to_output(T_('Permission to comment into this blog with private status'), 'htmlattr') . '\', \'comment\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'draft\', \'' . format_to_output(T_('Permission to comment into this blog with draft status'), 'htmlattr') . '\', \'comment\' )%' . '%coll_perm_status_checkbox( {row}, \'bloggroup_\', \'deprecated\', \'' . format_to_output(T_('Permission to comment into this blog with deprecated status'), 'htmlattr') . '\', \'comment\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Comments'), 'th' => T_('Edit cmts<br />/user level'), 'th_class' => 'checkright', 'default_dir' => 'D', 'td' => '%coll_perm_edit_cmt( {row}, \'bloggroup_\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Permissions on Comments'), 'th' => T_('Delete<br />cmts'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_delcmts', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_delcmts\', \'' . format_to_output(T_('Permission to delete comments on this blog'), 'htmlattr') . '\' )% ' . '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_recycle_owncmts\', \'' . format_to_output(T_('Permission to recycle comments on their own posts'), 'htmlattr') . '\' )% ' . '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_vote_spam_cmts\', \'' . format_to_output(T_('Permission to give a spam vote on any comment'), 'htmlattr') . '\' )% ', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Perms on Coll.'), 'th' => T_('Cats'), 'th_title' => T_('Categories'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_cats', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_cats\', \'' . format_to_output(T_('Permission to edit categories for this blog'), 'htmlattr') . '\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Perms on Coll.'), 'th' => T_('Feat.'), 'th_title' => T_('Features'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_properties', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_properties\', \'' . format_to_output(T_('Permission to edit blog features'), 'htmlattr') . '\' )%', 'td_class' => 'center'); $Results->cols[] = array('th_group' => T_('Perms on Coll.'), 'th' => get_admin_badge('coll', '#', T_('Coll.<br />Admin'), T_('Check this to give Collection Admin permission.')), 'th_title' => T_('Advanced/Administrative blog properties'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_admin', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_admin\', \'' . format_to_output(T_('Permission to edit advanced/administrative blog properties'), 'htmlattr') . '\' )%', 'td_class' => 'center'); // Media Directory: $Results->cols[] = array('th' => T_('Media<br />Dir'), 'th_class' => 'checkright', 'order' => 'bloggroup_perm_media_upload', 'default_dir' => 'D', 'td' => '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_media_upload\', \'' . format_to_output(T_('Permission to upload into blog\'s media folder'), 'htmlattr') . '\' )%' . '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_media_browse\', \'' . format_to_output(T_('Permission to browse blog\'s media folder'), 'htmlattr') . '\' )%' . '%coll_perm_checkbox( {row}, \'bloggroup_\', \'perm_media_change\', \'' . format_to_output(T_('Permission to change the blog\'s media folder content'), 'htmlattr') . '\' )%', 'td_class' => 'center'); $Results->cols[] = array('th' => ' ', 'td' => '%perm_check_all( {row}, \'bloggroup_\' )%', 'td_class' => 'center'); $Results->display(); echo '</div>'; // Permission note: // fp> TODO: link echo '<p class="note center">' . T_('Note: General group permissions may further restrict or extend any media folder permissions defined here.') . '</p>'; // Make a hidden list of all displayed users: $grp_IDs = array(); foreach ($Results->rows as $row) { $grp_IDs[] = $row->grp_ID; } $Form->hidden('group_IDs', implode(',', $grp_IDs)); $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
$Form->begin_form('fform', $title); } $Form->add_crumb('group'); $Form->hidden_ctrl(); $Form->hidden('action', 'update'); $Form->hidden('grp_ID', $edited_Group->ID); $perm_none_option = array('none', T_('No Access')); $perm_view_option = array('view', T_('View details')); $perm_edit_option = array('edit', T_('Edit/delete all')); $Form->begin_fieldset(T_('General') . get_manual_link('group_properties_general')); $Form->text('edited_grp_name', $edited_Group->name, 50, T_('Name'), '', 50, 'large'); $Form->text_input('edited_grp_level', $edited_Group->get('level'), 2, T_('Group level'), '[0 - 10]', array('required' => true)); display_pluggable_permissions($Form, 'core_general'); $Form->end_fieldset(); $Form->begin_fieldset(T_('Blogging permissions') . get_manual_link('group_properties_blogging')); $Form->radio('edited_grp_perm_blogs', $edited_Group->get('perm_blogs'), array(array('user', T_('Depending on each blog\'s permissions')), array('viewall', T_('View all blogs')), array('editall', T_('Full Access') . get_admin_badge('coll', '#', '#', T_('Select to give Collection Admin permission')))), T_('Collections'), false); $Form->radio('perm_xhtmlvalidation', $edited_Group->get('perm_xhtmlvalidation'), array(array('always', T_('Force valid XHTML + strong security'), T_('The security filters below will be strongly enforced.')), array('never', T_('Basic security checking'), T_('Security filters below will still be enforced but with potential lesser accuracy.'))), T_('XHTML validation'), true); $Form->radio('perm_xhtmlvalidation_xmlrpc', $edited_Group->get('perm_xhtmlvalidation_xmlrpc'), array(array('always', T_('Force valid XHTML + strong security'), T_('The security filters below will be strongly enforced.')), array('never', T_('Basic security checking'), T_('Security filters below will still be enforced but with potential lesser accuracy.'))), T_('XHTML validation on XML-RPC calls'), true); $Form->checklist(array(array('prevent_css_tweaks', 1, T_('Prevent CSS tweaks'), !$edited_Group->get('perm_xhtml_css_tweaks'), false, T_('WARNING: if allowed, users may deface the site, add hidden text, etc.')), array('prevent_iframes', 1, T_('Prevent iframes'), !$edited_Group->get('perm_xhtml_iframes'), false, T_('WARNING: if allowed, users may do XSS hacks, steal passwords from other users, etc.')), array('prevent_javascript', 1, T_('Prevent javascript'), !$edited_Group->get('perm_xhtml_javascript'), false, T_('WARNING: if allowed, users can easily do XSS hacks, steal passwords from other users, etc.')), array('prevent_objects', 1, T_('Prevent objects'), !$edited_Group->get('perm_xhtml_objects'), false, T_('WARNING: if allowed, users can spread viruses and malware through this blog.'))), 'xhtml_security', T_('Security filters')); $Form->checkbox('apply_antispam', !$edited_Group->get('perm_bypass_antispam'), T_('Antispam filtering'), T_('Inputs from these users will be checked against the antispam blacklist.')); // Display pluggable permissions: display_pluggable_permissions($Form, 'blogging'); $Form->end_fieldset(); $Form->begin_fieldset(T_('Additional permissions') . get_manual_link('group_properties_additional_permissions')); $Form->radio('edited_grp_perm_stats', $edited_Group->get('perm_stats'), array($perm_none_option, array('user', T_('View stats for specific blogs'), T_('Based on each blog\'s edit permissions')), array('view', T_('View stats for all blogs')), array('edit', T_('Full Access'), T_('Includes deleting/reassigning of stats'))), T_('Stats'), true); // Display pluggable permissions: display_pluggable_permissions($Form, 'additional'); $Form->end_fieldset(); $Form->begin_fieldset(T_('System admin permissions') . get_manual_link('group_properties_system_permissions')); // Display pluggable permissions: display_pluggable_permissions($Form, 'core');
if ($edited_User->check_perm('admin', 'restricted', false)) { // edited user has a permission to back-office $notify_options[] = array('edited_user_notify_meta_comments', 1, T_('a meta comment is posted.'), $UserSettings->get('notify_meta_comments', $edited_User->ID), $disabled); } if ($is_comment_moderator) { // edited user is comment moderator at least in one blog $notify_options[] = array('edited_user_send_cmt_moderation_reminder', 1, sprintf(T_('comments are awaiting moderation for more than %s.'), seconds_to_period($comment_moderation_reminder_threshold)), $UserSettings->get('send_cmt_moderation_reminder', $edited_User->ID), $disabled); } if ($edited_User->check_role('post_moderator')) { // edited user is post moderator at least in one blog $notify_options[] = array('edited_user_notify_post_moderation', 1, T_('a post is created and I have permissions to moderate it.'), $UserSettings->get('notify_post_moderation', $edited_User->ID), $disabled); $notify_options[] = array('edited_user_send_pst_moderation_reminder', 1, sprintf(T_('posts are awaiting moderation for more than %s.'), seconds_to_period($post_moderation_reminder_threshold)), $UserSettings->get('send_pst_moderation_reminder', $edited_User->ID), $disabled); } if ($current_User->check_perm('users', 'edit')) { // current User is an administrator $notify_options[] = array('edited_user_send_activation_reminder', 1, sprintf(T_('my account was deactivated or is not activated for more than %s.') . get_admin_badge('user'), seconds_to_period($activate_account_reminder_threshold)), $UserSettings->get('send_activation_reminder', $edited_User->ID)); } if ($edited_User->check_perm('users', 'edit')) { // edited user has permission to edit all users, save notification preferences $notify_options[] = array('edited_user_notify_new_user_registration', 1, T_('a new user has registered.'), $UserSettings->get('notify_new_user_registration', $edited_User->ID), $disabled); $notify_options[] = array('edited_user_notify_activated_account', 1, T_('an account was activated.'), $UserSettings->get('notify_activated_account', $edited_User->ID), $disabled); $notify_options[] = array('edited_user_notify_closed_account', 1, T_('an account was closed.'), $UserSettings->get('notify_closed_account', $edited_User->ID), $disabled); $notify_options[] = array('edited_user_notify_reported_account', 1, T_('an account was reported.'), $UserSettings->get('notify_reported_account', $edited_User->ID), $disabled); $notify_options[] = array('edited_user_notify_changed_account', 1, T_('an account was changed.'), $UserSettings->get('notify_changed_account', $edited_User->ID), $disabled); } if ($edited_User->check_perm('options', 'edit')) { // edited user has permission to edit options, save notification preferences $notify_options[] = array('edited_user_notify_cronjob_error', 1, T_('a scheduled task ends with an error or timeout.'), $UserSettings->get('notify_cronjob_error', $edited_User->ID), $disabled); } if (!empty($notify_options)) { $Form->checklist($notify_options, 'edited_user_notification', T_('Notify me by email whenever'), false, false, $checklist_params);
$Form->text('blog_footer_text', $edited_Blog->get_setting('blog_footer_text'), 60, T_('Blog footer'), sprintf(T_('Use <br /> to insert a line break. You might want to put your copyright or <a href="%s" target="_blank">creative commons</a> notice here.'), 'http://creativecommons.org/license/'), 1000, 'large'); $Form->textarea('single_item_footer_text', $edited_Blog->get_setting('single_item_footer_text'), 2, T_('Single post footer'), T_('This will be displayed after each post in single post view.') . ' ' . sprintf(T_('Available variables: %s.'), '<b>$perm_url$</b>, <b>$title$</b>, <b>$excerpt$</b>, <b>$author$</b>, <b>$author_login$</b>'), 50); $Form->textarea('xml_item_footer_text', $edited_Blog->get_setting('xml_item_footer_text'), 2, T_('Post footer in RSS/Atom'), T_('This will be appended to each post in your RSS/Atom feeds.') . ' ' . sprintf(T_('Available variables: %s.'), T_('same as above')), 50); $Form->textarea('blog_notes', $edited_Blog->get('notes'), 5, T_('Notes'), T_('Additional info. Appears in the backoffice.'), 50); $Form->end_fieldset(); $Form->begin_fieldset(T_('Software credits') . get_manual_link('software_credits')); $max_credits = $edited_Blog->get_setting('max_footer_credits'); $note = T_('You get the b2evolution software for <strong>free</strong>. We do appreciate you giving us credit. <strong>Thank you for your support!</strong>'); if ($max_credits < 1) { $note = '<img src="' . $rsc_url . 'smilies/icon_sad.gif" alt="" class="bottom"> ' . $note; } $Form->text('max_footer_credits', $max_credits, 1, T_('Max footer credits'), $note, 1); $Form->end_fieldset(); if ($current_User->check_perm('blog_admin', 'edit', false, $edited_Blog->ID)) { // Permission to edit advanced admin settings $Form->begin_fieldset(T_('Skin and style') . get_admin_badge()); $Form->checkbox('blog_allowblogcss', $edited_Blog->get('allowblogcss'), T_('Allow customized blog CSS file'), T_('You will be able to customize the blog\'s skin stylesheet with a file named style.css in the blog\'s media file folder.')); $Form->checkbox('blog_allowusercss', $edited_Blog->get('allowusercss'), T_('Allow user customized CSS file for this blog'), T_('Users will be able to customize the blog and skin stylesheets with a file named style.css in their personal file folder.')); $Form->textarea('blog_head_includes', $edited_Blog->get_setting('head_includes'), 5, T_('Custom meta tag/css section (before </head>)'), T_('Add custom meta tags and/or css styles to the <head> section. Example use: website verification, Google+, favicon image...'), 50); $Form->textarea('blog_footer_includes', $edited_Blog->get_setting('footer_includes'), 5, T_('Custom javascript section (before </body>)'), T_('Add custom javascript before the closing </body> tag in order to avoid any issues with page loading delays for visitors with slow connection speeds.<br />Example use: tracking scripts, javascript libraries...'), 50); $Form->end_fieldset(); } $Form->end_form(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton'))); ?> <script type="text/javascript"> jQuery( '#ajax_form_enabled' ).click( function() { if( jQuery( '#ajax_form_enabled' ).attr( "checked" ) ) { jQuery( '#ajax_form_loggedin_enabled' ).attr( "disabled", false );
$Form->radio('allow_rating_items', $edited_Blog->get_setting('allow_rating_items'), array($any_option, $registered_option, $member_option, $never_option), T_('Allow star ratings from'), true); $Form->textarea_input('rating_question', $edited_Blog->get_setting('rating_question'), 3, T_('Star rating question')); $Form->checkbox('allow_rating_comment_helpfulness', $edited_Blog->get_setting('allow_rating_comment_helpfulness'), T_('Allow helpful/not helpful'), T_('Allow users to say if a comment was helpful or not.')); $Form->end_fieldset(); // display comments settings provided by optional modules: // echo 'modules'; modules_call_method('display_collection_comments', array('Form' => &$Form, 'edited_Blog' => &$edited_Blog)); $Form->begin_fieldset(T_('Comment moderation') . get_manual_link('comment-moderation')); $is_bootstrap_skin = isset($AdminUI, $AdminUI->skin_name) && $AdminUI->skin_name == 'bootstrap'; $newstatus_warning_attrs = ' id="newstatus_warning" style="display:' . ($edited_Blog->get_setting('new_feedback_status') == 'published' ? 'inline' : 'none') . '"'; $newstatus_warning = str_replace('$attrs$', $newstatus_warning_attrs, $spammers_warning); $status_options = get_visibility_statuses('', array('redirected', 'trash')); if ($edited_Blog->get_setting('new_feedback_status') != 'published') { if ($perm_blog_admin) { // Only admin can set this setting to 'Public' $status_options['published'] .= $is_bootstrap_skin ? get_admin_badge('coll', false) : ' [' . T_('Admin') . ']'; } else { // Remove published status for non-admin users unset($status_options['published']); } } // put this on feedback details container, this way it won't be displayed if comment posting is not allowed echo '<div class="feedback_details_container">'; if ($is_bootstrap_skin) { // Use dropdown for bootstrap skin: $new_status_field = get_status_dropdown_button(array('name' => 'new_feedback_status', 'value' => $edited_Blog->get_setting('new_feedback_status'), 'options' => $status_options)); $Form->info(T_('New feedback status'), $new_status_field, $newstatus_warning . T_('Logged in users will get the highest possible status allowed by their permissions. Plugins may also override this default.')); $Form->hidden('new_feedback_status', $edited_Blog->get_setting('new_feedback_status')); echo_form_dropdown_js(); } else { // Use standard select element for other skins:
} echo '</p>'; } $Form->end_fieldset(); $Form->begin_fieldset(T_('Collection permissions') . get_manual_link('collection-permission-settings')); $owner_User =& $edited_Blog->get_owner_User(); if ($current_User->check_perm('blog_admin', 'edit', false, $edited_Blog->ID)) { // Permission to edit advanced admin settings // fp> Note: There are 2 reasons why we don't provide a select here: // 1. If there are 1000 users, it's a pain. // 2. A single blog owner is not necessarily allowed to see all other users. $Form->username('owner_login', $owner_User, T_('Owner'), T_('Login of this blog\'s owner.')); } else { $Form->info(T_('Owner'), $owner_User->login, $owner_User->dget('fullname')); } $Form->radio('advanced_perms', $edited_Blog->get('advanced_perms'), array(array('0', T_('Simple permissions'), sprintf(T_('(the owner above has most permissions on this collection, except %s)'), get_admin_badge())), array('1', T_('Advanced permissions'), sprintf(T_('(you can assign granular <a %s>user</a> and <a %s>group</a> permissions for this collection)'), 'href="' . $admin_url . '?ctrl=coll_settings&tab=perm&blog=' . $edited_Blog->ID . '"', 'href="' . $admin_url . '?ctrl=coll_settings&tab=permgroup&blog=' . $edited_Blog->ID . '"'))), T_('Permission management'), true); $Form->radio('blog_allow_access', $edited_Blog->get_setting('allow_access'), array(array('public', T_('Everyone (Public Blog)')), array('users', T_('Logged in users')), array('members', '<span id="allow_access_members_advanced_title"' . ($edited_Blog->get('advanced_perms') ? '' : ' style="display:none"') . '>' . T_('Members') . '</span>' . '<span id="allow_access_members_simple_title"' . ($edited_Blog->get('advanced_perms') ? ' style="display:none"' : '') . '>' . T_('Only the owner') . '</span>', '<span id="allow_access_members_advanced_note"' . ($edited_Blog->get('advanced_perms') ? '' : ' style="display:none"') . '>' . sprintf(T_('(Assign membership in <a %s>user</a> and <a %s>group</a> permissions for this collection)'), 'href="' . $admin_url . '?ctrl=coll_settings&tab=perm&blog=' . $edited_Blog->ID . '"', 'href="' . $admin_url . '?ctrl=coll_settings&tab=permgroup&blog=' . $edited_Blog->ID . '"') . '</span>')), T_('Allow access to'), true); $Form->end_fieldset(); $Form->begin_fieldset(T_('Lists of collections') . get_manual_link('collection-list-settings')); $Form->text('blog_order', $edited_Blog->get('order'), 10, T_('Order')); $Form->radio('blog_in_bloglist', $edited_Blog->get('in_bloglist'), array(array('public', T_('Always (Public)')), array('logged', T_('For logged-in users only')), array('member', T_('For members only')), array('never', T_('Never'))), T_('Show in front-office list'), true, T_('Select when you want this blog to appear in the list of blogs on this system.')); $Form->checkbox('favorite', $edited_Blog->get('favorite'), T_('Show in back-office favorites'), T_('Include in the quick blog selector at the top of the back office pages.')); $Form->end_fieldset(); $Form->begin_fieldset(T_('Description') . get_manual_link('collection-description')); $Form->text('blog_tagline', $edited_Blog->get('tagline'), 50, T_('Tagline'), T_('This is displayed under the blog name on the blog template.'), 250); $Form->textarea('blog_longdesc', $edited_Blog->get('longdesc'), 5, T_('Long Description'), T_('This is displayed on the blog template.'), 50); $Form->end_fieldset(); $Form->buttons(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton'))); $Form->end_form(); ?> <script type="text/javascript">
$Form->hidden_ctrl(); $Form->hidden('action', 'update'); $Form->hidden('tab', $tab); $Form->hidden('blog', $blog); global $baseurl, $basedomain; // determine siteurl type (if not set from update-action) if (preg_match('#https?://#', $edited_Blog->get('siteurl'))) { // absolute $blog_siteurl_relative = ''; $blog_siteurl_absolute = $edited_Blog->get('siteurl'); } else { // relative $blog_siteurl_relative = $edited_Blog->get('siteurl'); $blog_siteurl_absolute = 'http://'; } $Form->begin_fieldset(T_('Collection base URL') . get_admin_badge() . get_manual_link('collection-base-url-settings')); if ($current_User->check_perm('blog_admin', 'edit', false, $edited_Blog->ID)) { // Permission to edit advanced admin settings $Form->text('blog_urlname', $edited_Blog->get('urlname'), 20, T_('Collection URL name'), T_('Used to uniquely identify this collection. Appears in URLs and gets used as default for the media location (see the advanced tab).'), 255); if ($default_blog_ID = $Settings->get('default_blog_ID')) { $Debuglog->add('Default collection is set to: ' . $default_blog_ID); $BlogCache =& get_BlogCache(); if ($default_Blog =& $BlogCache->get_by_ID($default_blog_ID, false)) { // Default blog exists $defblog = $default_Blog->dget('shortname'); } } $siteurl_relative_warning = ''; if (!preg_match('~(^|/|\\.php.?)$~i', $blog_siteurl_relative)) { $siteurl_relative_warning = ' <span class="note red">' . T_('WARNING: it is highly recommended that this ends in with a / or .php !') . '</span>'; }