OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / moyoo_lane_street / 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                 <table class="adminform" width="100%">
55                 <tr>
56                         <td>
57                                 <div style="float: left;">
58                                         <label for="title"><?php echo JText::_( 'Title' ); ?>:</label>
59                                         <input class="inputbox" type="text" id="title" name="title" size="50" maxlength="100" value="<?php echo $this->escape($this->article->title); ?>" />
60                                         <input class="inputbox" type="hidden" id="alias" name="alias" value="<?php echo $this->escape($this->article->alias); ?>" />
61                                 </div>
62                                 <div style="float: right;">
63                                         <span class="art-button-wrapper">
64                                                 <span class="l"> </span>
65                                                 <span class="r"> </span>
66                                                 <input type="button" class="art-button" onclick="submitbutton('save')" value="<?php echo JText::_('Save') ?>"/>
67                                         </span>
68                                         <span class="art-button-wrapper">
69                                                 <span class="l"> </span>
70                                                 <span class="r"> </span>
71                                                 <input type="button" class="art-button" onclick="submitbutton('cancel')" value="<?php echo JText::_('Cancel') ?>"/>
72                                         </span>
73                                 </div>
74                         </td>
75                 </tr>
76                 </table>
77                 <?php echo $this->editor->display('text', $this->article->text, '100%', '400', '70', '15'); ?>
78         </fieldset>
79         <fieldset>
80                 <legend><?php echo JText::_('Publishing'); ?></legend>
81                 <table class="adminform">
82                 <tr>
83                         <td class="key"><label for="sectionid"><?php echo JText::_( 'Section' ); ?>:</label></td>
84                         <td><?php echo $this->lists['sectionid']; ?></td>
85                 </tr>
86                 <tr>
87                         <td class="key"><label for="catid"><?php echo JText::_( 'Category' ); ?>:</label></td>
88                         <td><?php echo $this->lists['catid']; ?></td>
89                 </tr>
90                 <?php if ($this->user->authorize('com_content', 'publish', 'content', 'all')) : ?>
91                 <tr>
92                         <td class="key"><label for="state"><?php echo JText::_( 'Published' ); ?>:</label></td>
93                         <td><?php echo $this->lists['state']; ?></td>
94                 </tr>
95                 <?php endif; ?>
96                 <tr>
97                         <td width="120" class="key"><label for="frontpage"><?php echo JText::_( 'Show on Front Page' ); ?>:</label></td>
98                         <td><?php echo $this->lists['frontpage']; ?></td>
99                 </tr>
100                 <tr>
101                         <td class="key"><label for="created_by_alias"><?php echo JText::_( 'Author Alias' ); ?>:</label></td>
102                         <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>
103                 </tr>
104                 <tr>
105                         <td class="key"><label for="publish_up"><?php echo JText::_( 'Start Publishing' ); ?>:</label></td>
106                         <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>
107                 </tr>
108                 <tr>
109                         <td class="key"><label for="publish_down"><?php echo JText::_( 'Finish Publishing' ); ?>:</label></td>
110                         <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>
111                 </tr>
112                 <tr>
113                         <td valign="top" class="key"><label for="access"><?php echo JText::_( 'Access Level' ); ?>:</label></td>
114                         <td><?php echo $this->lists['access']; ?></td>
115                 </tr>
116                 <tr>
117                         <td class="key"><label for="ordering"><?php echo JText::_( 'Ordering' ); ?>:</label></td>
118                         <td><?php echo $this->lists['ordering']; ?></td>
119                 </tr>
120                 </table>
121         </fieldset>
122
123         <fieldset>
124                 <legend><?php echo JText::_('Metadata'); ?></legend>
125                 <table class="adminform" width="100%">
126                 <tr>
127                         <td valign="top" class="key" width="120"><label for="metadesc"><?php echo JText::_( 'Description' ); ?>:</label></td>
128                         <td>
129                                 <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>
130                         </td>
131                 </tr>
132                 <tr>
133                         <td valign="top" class="key" width="120"><label for="metakey"><?php echo JText::_( 'Keywords' ); ?>:</label></td>
134                         <td>
135                                 <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>
136                         </td>
137                 </tr>
138                 </table>
139         </fieldset>
140
141         <input type="hidden" name="option" value="com_content" />
142         <input type="hidden" name="id" value="<?php echo $this->article->id; ?>" />
143         <input type="hidden" name="version" value="<?php echo $this->article->version; ?>" />
144         <input type="hidden" name="created_by" value="<?php echo $this->article->created_by; ?>" />
145         <input type="hidden" name="referer" value="<?php echo isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; ?>" />
146         <?php echo JHTML::_( 'form.token' ); ?>
147         <input type="hidden" name="task" value="" />
148 </form>
149 <?php echo JHTML::_('behavior.keepalive'); ?>
150 <?php echo artxPost(artxPageTitle($this), ob_get_clean()); ?>