OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / car_city_v1 / html / com_content / article / form.php
1 <?php
2 defined('_JEXEC') or die('Restricted access'); // no direct access
3 require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php');
4 ?>
5 <?php ob_start(); ?>
6 <script language="javascript" type="text/javascript">
7 function setgood()
8 {
9         return true;
10 }
11
12 var sectioncategories = [];
13 <?php
14 $i = 0;
15 foreach ($this->lists['sectioncategories'] as $k => $items) {
16         foreach ($items as $v) {
17                 echo "sectioncategories[" . $i++ . "] = ['$k', '" . addslashes($v->id) . "', '" . addslashes( $v->title ) . "'];\n\t\t";
18         }
19 }
20 ?>
21
22 function submitbutton(pressbutton)
23 {
24         var form = document.adminForm;
25         if (pressbutton == 'cancel') {
26                 submitform(pressbutton);
27                 return;
28         }
29         try {
30                 form.onsubmit();
31         } catch (e) {
32                 alert(e);
33         }
34
35         // do field validation
36         var text = <?php echo $this->editor->getContent( 'text' ); ?>
37         if (form.title.value == '') {
38                 return alert ("<?php echo JText::_( 'Article must have a title', true ); ?>");
39         } else if (text == '') {
40                 return alert ("<?php echo JText::_( 'Article must have some text', true ); ?>");
41         } else if (parseInt('<?php echo $this->article->sectionid;?>')) {
42                 // for articles
43                 if (form.catid && getSelectedValue('adminForm','catid') < 1) {
44                         return alert("<?php echo JText::_( 'Please select a category', true ); ?>");
45                 }
46         }
47         <?php echo $this->editor->save('text'); ?>
48         submitform(pressbutton);
49 }
50 </script>
51 <form action="<?php echo $this->action ?>" method="post" name="adminForm" onSubmit="setgood();">
52         <fieldset>
53                 <legend><?php echo JText::_('Editor'); ?></legend>
54                 <div class="adminform">
55                         <div style="float: left;">
56                                 <label for="title"><?php echo JText::_( 'Title' ); ?>:</label>
57                                 <input class="inputbox" type="text" id="title" name="title" size="50" maxlength="100" value="<?php echo $this->escape($this->article->title); ?>" />
58                                 <input class="inputbox" type="hidden" id="alias" name="alias" value="<?php echo $this->escape($this->article->alias); ?>" />
59                         </div>
60                         <div style="float: right;">
61                                 <span class="art-button-wrapper">
62                                         <span class="l"> </span>
63                                         <span class="r"> </span>
64                                         <input type="button" class="art-button" onclick="submitbutton('save')" value="<?php echo JText::_('Save') ?>" />
65                                 </span>
66                                 <span class="art-button-wrapper">
67                                         <span class="l"> </span>
68                                         <span class="r"> </span>
69                                         <input type="button" class="art-button" onclick="submitbutton('cancel')" value="<?php echo JText::_('Cancel') ?>" />
70                                 </span>
71                         </div>
72                         <div style="clear: both;"></div>
73                 </div>
74                 <?php echo $this->editor->display('text', $this->article->text, '100%', '400', '70', '15'); ?>
75         </fieldset>
76         <fieldset>
77                 <legend><?php echo JText::_('Publishing'); ?></legend>
78                 <table class="adminform">
79                 <tr>
80                         <td class="key"><label for="sectionid"><?php echo JText::_( 'Section' ); ?>:</label></td>
81                         <td><?php echo $this->lists['sectionid']; ?></td>
82                 </tr>
83                 <tr>
84                         <td class="key"><label for="catid"><?php echo JText::_( 'Category' ); ?>:</label></td>
85                         <td><?php echo $this->lists['catid']; ?></td>
86                 </tr>
87                 <?php if ($this->user->authorize('com_content', 'publish', 'content', 'all')) : ?>
88                 <tr>
89                         <td class="key"><label for="state"><?php echo JText::_( 'Published' ); ?>:</label></td>
90                         <td><?php echo $this->lists['state']; ?></td>
91                 </tr>
92                 <?php endif; ?>
93                 <tr>
94                         <td width="120" class="key"><label for="frontpage"><?php echo JText::_( 'Show on Front Page' ); ?>:</label></td>
95                         <td><?php echo $this->lists['frontpage']; ?></td>
96                 </tr>
97                 <tr>
98                         <td class="key"><label for="created_by_alias"><?php echo JText::_( 'Author Alias' ); ?>:</label></td>
99                         <td><input type="text" id="created_by_alias" name="created_by_alias" size="50" maxlength="100" value="<?php echo $this->article->created_by_alias; ?>" class="inputbox" /></td>
100                 </tr>
101                 <tr>
102                         <td class="key"><label for="publish_up"><?php echo JText::_( 'Start Publishing' ); ?>:</label></td>
103                         <td><?php echo JHTML::_('calendar', $this->article->publish_up, 'publish_up', 'publish_up', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25',  'maxlength'=>'19')); ?></td>
104                 </tr>
105                 <tr>
106                         <td class="key"><label for="publish_down"><?php echo JText::_( 'Finish Publishing' ); ?>:</label></td>
107                         <td><?php echo JHTML::_('calendar', $this->article->publish_down, 'publish_down', 'publish_down', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25',  'maxlength'=>'19')); ?></td>
108                 </tr>
109                 <tr>
110                         <td valign="top" class="key"><label for="access"><?php echo JText::_( 'Access Level' ); ?>:</label></td>
111                         <td><?php echo $this->lists['access']; ?></td>
112                 </tr>
113                 <tr>
114                         <td class="key"><label for="ordering"><?php echo JText::_( 'Ordering' ); ?>:</label></td>
115                         <td><?php echo $this->lists['ordering']; ?></td>
116                 </tr>
117                 </table>
118         </fieldset>
119
120         <fieldset>
121                 <legend><?php echo JText::_('Metadata'); ?></legend>
122                 <table class="adminform" width="100%">
123                 <tr>
124                         <td valign="top" class="key" width="120"><label for="metadesc"><?php echo JText::_( 'Description' ); ?>:</label></td>
125                         <td>
126                                 <textarea rows="5" cols="50" style="width: 95%; height: 120px" class="inputbox" id="metadesc" name="metadesc"><?php echo str_replace('&','&amp;',$this->article->metadesc); ?></textarea>
127                         </td>
128                 </tr>
129                 <tr>
130                         <td valign="top" class="key" width="120"><label for="metakey"><?php echo JText::_( 'Keywords' ); ?>:</label></td>
131                         <td>
132                                 <textarea rows="5" cols="50" style="width: 95%; height: 50px" class="inputbox" id="metakey" name="metakey"><?php echo str_replace('&','&amp;',$this->article->metakey); ?></textarea>
133                         </td>
134                 </tr>
135                 </table>
136         </fieldset>
137
138         <input type="hidden" name="option" value="com_content" />
139         <input type="hidden" name="id" value="<?php echo $this->article->id; ?>" />
140         <input type="hidden" name="version" value="<?php echo $this->article->version; ?>" />
141         <input type="hidden" name="created_by" value="<?php echo $this->article->created_by; ?>" />
142         <input type="hidden" name="referer" value="<?php echo isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; ?>" />
143         <?php echo JHTML::_( 'form.token' ); ?>
144         <input type="hidden" name="task" value="" />
145 </form>
146 <?php echo JHTML::_('behavior.keepalive'); ?>
147 <?php echo artxPost(artxPageTitle($this), ob_get_clean()); ?>