~quam-plures-core/quam-plures/qp5_colls-blogs_chaps-cats

« back to all changes in this revision

Viewing changes to qp_inc/blogs/views/_blog_general.form.php

  • Committer: EdB
  • Date: 2013-03-12 06:26:03 UTC
  • Revision ID: 1912webworks@gmail.com-20130312062603-tnlb5zco5mglydqj
lots of changes in this branch. tested and functional, but not going into merge just yet ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * This file implements the UI view for the General blog properties
 
4
 *
 
5
 * @author {@link http://wonderwinds.com/ Ed Bennett}
 
6
 * @author {@link http://daniel.hahler.de/ Daniel HAHLER}
 
7
 * @author {@link http://fplanque.net/ Francois PLANQUE}
 
8
 * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
 
9
 * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
 
10
 * @package blogs
 
11
 */
 
12
if(!defined('QP_MAIN_INIT')) die('fail');
 
13
 
 
14
global $action;
 
15
global $blog;
 
16
global $blogtemplate;
 
17
global $edited_Blog;
 
18
global $next_action;
 
19
global $tab;
 
20
 
 
21
$Form = new Form();
 
22
$Form->begin_form( 'fform' );
 
23
$Form->hidden_ctrl();
 
24
$Form->hidden( 'action', $next_action );
 
25
$Form->hidden( 'tab', $tab );
 
26
if( $next_action == 'create' )
 
27
{
 
28
        $Form->hidden( 'kind', get_param( 'kind' ) );
 
29
        $Form->hidden( 'template_ID', get_param( 'template_ID' ) );
 
30
}
 
31
else
 
32
{
 
33
        $Form->hidden( 'blog', $blog );
 
34
}
 
35
 
 
36
$Form->begin_fieldset( T_('General parameters'), array( 'class' => 'fieldset clear' ) );
 
37
        $Form->text( 'blog_name', $edited_Blog->get( 'name' ), 50, T_('Title'), T_('Will be displayed on top of the blog.'), 255 );
 
38
        $Form->text( 'blog_shortname', $edited_Blog->get( 'shortname', 'formvalue' ), 15, T_('Short name'), T_('Will be used in selection menus and throughout the admin interface.'), 255 );
 
39
 
 
40
        $owner_User = & $edited_Blog->get_owner_User();
 
41
        if( $current_User->check_perm( 'blog_admin', 'edit', false, $edited_Blog->ID ) )
 
42
        {
 
43
                // Permission to edit advanced admin settings
 
44
                $Form->text( 'blog_urlname', $edited_Blog->get( 'urlname' ), 20, T_('URL "filename"'),
 
45
                        T_('"slug" used to uniquely identify this blog in URLs'), 255 );
 
46
                // fp> Note: There are 2 reasons why we don't provide a select here
 
47
                // 1. If there are 1000 users, it's a pain.
 
48
                // 2. A single blog owner is not necessarily allowed to see all other users.
 
49
                $Form->text( 'owner_login', $owner_User->login, 20, T_('Owner'), T_('Login of this blog\'s owner.') );
 
50
        }
 
51
        else
 
52
        {
 
53
                $Form->info( T_('URL Name'), $edited_Blog->get( 'urlname' ), T_('Used to uniquely identify this blog in URLs.') /* Note: message voluntarily shorter than admin message */ );
 
54
                $Form->info( T_('Owner'), $owner_User->login, $owner_User->dget( 'fullname' ) );
 
55
        }
 
56
 
 
57
        $Form->select( 'blog_locale', $edited_Blog->get( 'locale' ), 'locale_options_return', T_('Main Locale'), T_('Determines the language of the navigation links on the blog.') );
 
58
$Form->end_fieldset();
 
59
 
 
60
$Form->begin_fieldset( T_('Content / Posts') );
 
61
        $Form->select_input_array( 'orderby', $edited_Blog->get_setting( 'orderby' ), get_available_sort_options(), T_('Order by'), T_('Default ordering of posts.') );
 
62
        $Form->select_input_array( 'orderdir', $edited_Blog->get_setting( 'orderdir' ), array(
 
63
                'ASC' => T_('Ascending'),
 
64
                'DESC' => T_('Descending'),
 
65
        ), T_('Direction') );
 
66
        $Form->radio( 'what_to_show', $edited_Blog->get_setting( 'what_to_show' ), array(
 
67
                array( 'days', T_('days') ),
 
68
                array( 'posts', T_('posts') )
 
69
        ), T_('Display unit'), false, T_('Do you want to restrict on the number of days or the number of posts?') );
 
70
        $Form->text( 'posts_per_page', $edited_Blog->get_setting( 'posts_per_page' ), 4, T_('Posts/Days per page'), T_('How many days or posts do you want to display on the home page?'), 4 );
 
71
        $Form->radio( 'archive_mode', $edited_Blog->get_setting( 'archive_mode' ), array(
 
72
                array( 'monthly', T_('monthly') ),
 
73
                array( 'weekly', T_('weekly') ),
 
74
                array( 'daily', T_('daily') ),
 
75
                array( 'postbypost', T_('post by post') )
 
76
        ), T_('Archive grouping'), false, T_('How do you want to browse the post archives? May also apply to permalinks.') );
 
77
$Form->end_fieldset();
 
78
 
 
79
$Form->begin_fieldset( T_('Description') );
 
80
        $Form->text( 'blog_tagline', $edited_Blog->get( 'tagline' ), 50, T_('Tagline'), T_('This is displayed under the blog name on the blog template.'), 250 );
 
81
        $Form->textarea( 'blog_longdesc', $edited_Blog->get( 'longdesc' ), 5, T_('Long Description'), T_('This is displayed on the blog template.'), 50, 'large' );
 
82
        $Form->text( 'blog_footer_text', $edited_Blog->get_setting( 'blog_footer_text' ), 60, T_('Blog footer'), T_('Use &lt;br /&gt; to insert a line break.'), 1000, 'large' );
 
83
        $Form->textarea( 'single_item_footer_text', $edited_Blog->get_setting( 'single_item_footer_text' ), 2, T_('Single post footer'),
 
84
                T_('This will be displayed after each post in single post view.'), 50, 'large' );
 
85
$Form->end_fieldset();
 
86
 
 
87
$Form->begin_fieldset( T_('Meta data') );
 
88
        $Form->text( 'blog_description', $edited_Blog->get( 'description' ), 60, T_('Short Description'), T_('This is is used in meta tag description and RSS feeds. NO HTML!'), 250, 'large' );
 
89
        $Form->text( 'blog_keywords', $edited_Blog->get( 'keywords' ), 60, T_('Keywords'), T_('This is is used in meta tag keywords. NO HTML!'), 250, 'large' );
 
90
        $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.'), 50, 'large' );
 
91
        $Form->textarea( 'blog_notes', $edited_Blog->get( 'notes' ), 5, T_('Notes'), T_('Additional info. Appears in the backoffice.'), 50, 'large' );
 
92
$Form->end_fieldset();
 
93
 
 
94
if( $current_User->check_perm( 'blog_admin', 'edit', false, $edited_Blog->ID ) )
 
95
{
 
96
        global $media_path;
 
97
 
 
98
        // Permission to edit advanced admin settings
 
99
        $Form->begin_fieldset( T_('Aggregation').' ['.T_('Admin').']' );
 
100
        $Form->text( 'aggregate_blog_IDs', $edited_Blog->get_setting( 'aggregate_blog_IDs' ), 30, T_('Blogs to aggregate'), T_('List blog IDs separated by ,'), 255 );
 
101
        $Form->end_fieldset();
 
102
 
 
103
        $Form->begin_fieldset( T_('Media directory location').' ['.T_('Admin').']' );
 
104
        $Form->radio( 'blog_media_location', $edited_Blog->get( 'media_location' ), array(
 
105
                array( 'none', T_('None') ),
 
106
                array( 'default', T_('Default'), $media_path.'blogs/id_'.$edited_Blog->ID.'/' ),
 
107
                array( 'subdir', T_('Subdirectory of media folder').':',
 
108
                '',
 
109
                ' <span class="nobr"><code>'.$media_path.'</code><input
 
110
                type="text" name="blog_media_subdir" class="form_text_input" size="20" maxlength="255"
 
111
                class="'.( param_has_error('blog_media_subdir') ? 'field_error' : '' ).'"
 
112
                value="'.$edited_Blog->dget( 'media_subdir', 'formvalue' ).'" /></span>', '' ),
 
113
                array( 'custom',
 
114
                T_('Custom location').':',
 
115
                '',
 
116
                '<fieldset>'
 
117
                .'<div class="label">'.T_('directory').':</div><div class="input"><input
 
118
                type="text" class="form_text_input" name="blog_media_fullpath" size="50" maxlength="255"
 
119
                class="'.( param_has_error('blog_media_fullpath') ? 'field_error' : '' ).'"
 
120
                value="'.$edited_Blog->dget( 'media_fullpath', 'formvalue' ).'" /></div>'
 
121
                .'<div class="label">'.T_('URL').':</div><div class="input"><input
 
122
                type="text" class="form_text_input" name="blog_media_url" size="50" maxlength="255"
 
123
                class="'.( param_has_error('blog_media_url') ? 'field_error' : '' ).'"
 
124
                value="'.$edited_Blog->dget( 'media_url', 'formvalue' ).'" /></div></fieldset>' ) ),
 
125
                T_('Media directory'), true );
 
126
        $Form->end_fieldset();
 
127
}
 
128
 
 
129
$Form->buttons( array(
 
130
        array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 
131
        array( 'reset', '', T_('Reset'), 'ResetButton' ),
 
132
) );
 
133
 
 
134
$Form->end_form();
 
135
 
 
136
?>