the-art-of-joomla-archive /contentmanager/code/trunk/components/com_contentmanager/views/article/tmpl/edit.php

Language PHP Lines 245
MD5 Hash b0e817db6c6e952aea91605822060070 Estimated Cost $2,231 (why?)
Repository https://bitbucket.org/eddieajau/the-art-of-joomla-archive View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?php
/**
 * @version		$Id: edit.php 330 2010-10-18 01:15:44Z eddieajau $
 * @package		TAOJ.ContentManager
 * @subpackage	com_contentmanager
 * @copyright	Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

defined('_JEXEC') or die;

JHTML::addIncludePath(JPATH_COMPONENT.DS.'helpers'.DS.'html');

$modal = $this->params->get('config-modal');

JHTML::stylesheet('edit.css',		'components/com_contentmanager/media/css/');
JHTML::_('behavior.tooltip');
JHTML::_('behavior.formvalidation');
jimport('joomla.html.pane');
$pane	=& JPane::getInstance('tabs');

// Workaround to make sure the buttons work properly.
$acl		= &JFactory::getACL();
$oldMode	= $acl->setCheckMode(0);
$fields	= $this->form->getFields('jxform');
$acl->setCheckMode($oldMode);
?>
<script language="javascript" type="text/javascript">
<!--
	function submitbutton(task)
	{
		var form = document.adminForm;
		if (task == 'cancel' || document.formvalidator.isValid(document.adminForm)) {
		<?php
			$editor	=& JFactory::getEditor();
			echo $editor->save('jxform[introtext]');
			echo $editor->save('jxform[fulltext]');
		?>
			submitform(task);
		}
	}
-->
</script>
<div id="edit">
<?php echo $this->form->getHead(); ?>

	<fieldset class="actions">
		<input class="button validate" type="submit" name="task[article.save]" value="<?php echo JText::_('Save'); ?>" />
		<?php if ($modal) : ?>
		<input class="button" type="button" onclick="window.parent.document.getElementById('sbox-window').close();" value="<?php echo JText::_('Cancel'); ?>" />
		<?php else : ?>
		<input class="button" type="submit" name="task[article.cancel]" value="<?php echo JText::_('Cancel'); ?>" />
		<?php endif; ?>
	</fieldset>

	<fieldset>
		<?php if ($id = $fields['id']->value) : ?>
		<legend><?php echo JText::sprintf('Article #%d', $id); ?></legend>
		<?php endif; ?>
		<table>
			<tbody>
				<tr>
					<td>
						<?php echo $fields['title']->label; ?><br />
						<?php echo $fields['title']->field; ?>
					</td>
					<td>
						<?php echo $fields['alias']->label; ?><br />
						<?php echo $fields['alias']->field; ?>
					</td>
				</tr>
				<tr>
					<td>
						<?php //echo $fields['subtitle']->label; ?><br />
						<?php //echo $fields['subtitle']->field; ?>
					</td>
					<td>
						<?php //echo $fields['link']->label; ?><br />
						<?php //echo $fields['link']->field; ?>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="clr"></div>
	<?php echo $pane->startPane('article-edit'); ?>
	<?php echo $pane->startPanel(JText::_('Editor'), 'editor-page'); ?>
		<fieldset>
			<legend><?php echo $fields['introtext']->label; ?></legend>
			<?php echo $fields['introtext']->field; ?>
		</fieldset>
		<fieldset>
			<legend><?php echo $fields['fulltext']->label; ?></legend>
			<?php echo $fields['fulltext']->field; ?>
		</fieldset>
		<div style="display:none;"><?php echo $fields['id']->field; ?></div>
	<?php echo $pane->endPanel(); ?>
	<?php echo $pane->startPanel(JText::_('Publishing'), 'publishing-page'); ?>
		<fieldset style="width: 45%; float: left">
			<legend><?php echo JText::_('Publishing'); ?></legend>

			<ol>
				<li>
					<?php echo $fields['state']->label; ?><br />
					<?php echo $fields['state']->field; ?>
				</li>
<?php if ($this->access->get('edit.article.access')) : ?>
				<li>
					<?php echo $fields['access']->label; ?><br />
					<?php echo $fields['access']->field; ?>
				</li>
<?php endif; ?>
				<li>
					<?php echo $fields['publish_up']->label; ?><br />
					<?php echo $fields['publish_up']->field; ?>
				</li>
				<li>
					<?php echo $fields['publish_down']->label; ?><br />
					<?php echo $fields['publish_down']->field; ?>
				</li>
			</ol>
		</fieldset>
		<fieldset style="width: 45%; float: left">
			<legend><?php echo JText::_('Organization'); ?></legend>

			<ol>
				<li>
					<?php echo $fields['sectionid']->label; ?><br />
					<input type="text" size="30" value="<?php echo htmlentities($this->item->section_title);?>" class="readonly" readonly="readonly" />
					<?php echo $fields['sectionid']->field; ?>
				</li>
				<li>
					<?php echo $fields['catid']->label; ?><br />
					<?php echo $fields['catid']->field; ?>
				</li>
				<li>
					<?php echo $fields['ordering']->label; ?><br />
					<?php echo $fields['ordering']->field; ?>
				</li>
<?php if ($this->access->get('edit.article.author')) : ?>
				<li>
					<?php echo $fields['created']->label; ?><br />
					<?php echo $fields['created']->field; ?>
				</li>
				<li>
					<?php echo $fields['created_by']->label; ?><br />
					<?php echo $fields['created_by']->field; ?>
				</li>
				<li>
					<?php echo $fields['created_by_alias']->label; ?><br />
					<?php echo $fields['created_by_alias']->field; ?>
				</li>
<?php endif; ?>
			</ol>
		</fieldset>
		<div class="clr"></div>
	<?php echo $pane->endPanel(); ?>
<?php if ($this->access->get('edit.article.parameters')) : ?>
	<?php echo $pane->startPanel(JText::_('Parameters'), 'params-page'); ?>
		<table cellspacing="2" cellpadding="2">
			<tbody>
				<tr valign="top">
					<td>
						<fieldset>
							<legend><?php echo $fields['attribs']->label; ?></legend>

							<?php echo $fields['attribs']->field; ?>
						</fieldset>
					</td>
					<td>
					</td>
				</tr>
			</tbody>
		</table>
	<?php echo $pane->endPanel(); ?>
<?php endif; ?>
	<?php echo $pane->startPanel(JText::_('Metadata'), 'metadata-page'); ?>
		<table cellspacing="2" cellpadding="2">
			<tbody>
				<tr valign="top">
					<td>
						<fieldset>
							<legend><?php echo JText::_('Metadata'); ?></legend>

							<ol>
								<li>
									<?php echo $fields['metakey']->label; ?><br />
									<?php echo $fields['metakey']->field; ?>
								</li>
								<li>
									<?php echo $fields['metadesc']->label; ?><br />
									<?php echo $fields['metadesc']->field; ?>
								</li>
								<li>
									<?php echo $fields['metadata']->label; ?><br />
									<?php echo $fields['metadata']->field; ?>
								</li>
							</ol>
						</fieldset>
					</td>
					<td>
						<fieldset>
							<legend><?php echo JText::_('Metadata'); ?></legend>
							<ol>
								<li>
									<?php echo $fields['modified']->label; ?><br />
									<?php echo $fields['modified']->field; ?>
								</li>
<?php if ($this->access->get('edit.article.author')) : ?>
								<li>
									<?php echo $fields['hits']->label; ?><br />
									<?php echo $fields['hits']->field; ?>
								</li>
<?php endif; ?>
								<li>
									<?php echo $fields['version']->label; ?><br />
									<?php echo $fields['version']->field; ?>
								</li>
							</ol>
						</fieldset>

					</td>
				</tr>
			</tbody>
		</table>
	<?php echo $pane->endPanel(); ?>
<?php echo $pane->endPane(); ?>
	<div class="clr"></div>

	<input type="hidden" name="redirect" value="<?php echo $this->redirect; ?>" />
	</fieldset>
<?php echo $this->form->getFoot(); ?>
</div>

<script type="text/javascript">
// Attach the onblur event to auto-create the alias
e = document.getElementById('jxform_title');
e.onblur = function(){
	title = document.getElementById('jxform_title');
	alias = document.getElementById('jxform_alias');
	if (alias.value=='') {
		alias.value = title.value.replace(/[\s\-]+/g,'-').replace(/&/g,'and').replace(/[^A-Z0-9\-\_]/ig,'').toLowerCase();
	}
}
</script>
Back to Top