You've already forked joomla_test
first commit
This commit is contained in:
1
components/com_content/views/form/index.html
Normal file
1
components/com_content/views/form/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
6
components/com_content/views/form/metadata.xml
Normal file
6
components/com_content/views/form/metadata.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view title="Form">
|
||||
<message><![CDATA[TYPEARTICLAYDESC]]></message>
|
||||
</view>
|
||||
</metadata>
|
342
components/com_content/views/form/tmpl/edit.php
Normal file
342
components/com_content/views/form/tmpl/edit.php
Normal file
@ -0,0 +1,342 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('behavior.calendar');
|
||||
JHtml::_('behavior.formvalidation');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
// Create shortcut to parameters.
|
||||
$params = $this->state->get('params');
|
||||
//$images = json_decode($this->item->images);
|
||||
//$urls = json_decode($this->item->urls);
|
||||
|
||||
// This checks if the editor config options have ever been saved. If they haven't they will fall back to the original settings.
|
||||
$editoroptions = isset($params->show_publishing_options);
|
||||
if (!$editoroptions)
|
||||
{
|
||||
$params->show_urls_images_frontend = '0';
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == 'article.cancel' || document.formvalidator.isValid(document.id('adminForm')))
|
||||
{
|
||||
<?php echo $this->form->getField('articletext')->save(); ?>
|
||||
Joomla.submitform(task);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="edit item-page<?php echo $this->pageclass_sfx; ?>">
|
||||
<?php if ($params->get('show_page_heading', 1)) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_content&a_id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('article.save')">
|
||||
<span class="icon-ok"></span> <?php echo JText::_('JSAVE') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn" onclick="Joomla.submitbutton('article.cancel')">
|
||||
<span class="icon-cancel"></span> <?php echo JText::_('JCANCEL') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#editor" data-toggle="tab"><?php echo JText::_('JEDITOR') ?></a></li>
|
||||
<?php if ($params->get('show_urls_images_frontend') ) : ?>
|
||||
<li><a href="#images" data-toggle="tab"><?php echo JText::_('COM_CONTENT_IMAGES_AND_URLS') ?></a></li>
|
||||
<?php endif; ?>
|
||||
<li><a href="#publishing" data-toggle="tab"><?php echo JText::_('COM_CONTENT_PUBLISHING') ?></a></li>
|
||||
<li><a href="#language" data-toggle="tab"><?php echo JText::_('JFIELD_LANGUAGE_LABEL') ?></a></li>
|
||||
<li><a href="#metadata" data-toggle="tab"><?php echo JText::_('COM_CONTENT_METADATA') ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="editor">
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('title'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('title'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (is_null($this->item->id)) : ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('alias'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('alias'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $this->form->getInput('articletext'); ?>
|
||||
</div>
|
||||
<?php if ($params->get('show_urls_images_frontend')): ?>
|
||||
<div class="tab-pane" id="images">
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('image_intro', 'images'); ?>
|
||||
<?php echo $this->form->getInput('image_intro', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('image_intro_alt', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('image_intro_alt', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('image_intro_caption', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('image_intro_caption', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('float_intro', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('float_intro', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('image_fulltext', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('image_fulltext', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('image_fulltext_alt', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('image_fulltext_alt', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('image_fulltext_caption', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('image_fulltext_caption', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('float_fulltext', 'images'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('float_fulltext', 'images'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('urla', 'urls'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('urla', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('urlatext', 'urls'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('urlatext', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('targeta', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('urlb', 'urls'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('urlb', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('urlbtext', 'urls'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('urlbtext', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('targetb', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('urlc', 'urls'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('urlc', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('urlctext', 'urls'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('urlctext', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('targetc', 'urls'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="tab-pane" id="publishing">
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('catid'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('catid'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('tags'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('tags'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('created_by_alias'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('created_by_alias'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($this->item->params->get('access-change')) : ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('state'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('state'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('featured'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('featured'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('publish_up'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('publish_up'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('publish_down'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('publish_down'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('access'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('access'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (is_null($this->item->id)):?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo JText::_('COM_CONTENT_ORDERING'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="tab-pane" id="language">
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('language'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('language'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="metadata">
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('metadesc'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('metadesc'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('metakey'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('metakey'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
|
||||
<?php if ($this->params->get('enable_category', 0) == 1) :?>
|
||||
<input type="hidden" name="jform[catid]" value="<?php echo $this->params->get('catid', 1); ?>" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
29
components/com_content/views/form/tmpl/edit.xml
Normal file
29
components/com_content/views/form/tmpl/edit.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_CONTENT_FORM_VIEW_DEFAULT_TITLE" option="COM_CONTENT_FORM_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CREATE"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_CONTENT_FORM_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field name="enable_category"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="COM_CONTENT_CREATE_ARTICLE_CATEGORY_LABEL"
|
||||
description="COM_CONTENT_CREATE_ARTICLE_CATEGORY_DESC">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="catid"
|
||||
type="category"
|
||||
label="JGLOBAL_CHOOSE_CATEGORY_LABEL"
|
||||
extension="com_content"
|
||||
description="JGLOBAL_CHOOSE_CATEGORY_DESC" />
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
1
components/com_content/views/form/tmpl/index.html
Normal file
1
components/com_content/views/form/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
145
components/com_content/views/form/view.html.php
Normal file
145
components/com_content/views/form/view.html.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* HTML Article View class for the Content component
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
* @since 1.5
|
||||
*/
|
||||
class ContentViewForm extends JViewLegacy
|
||||
{
|
||||
protected $form;
|
||||
|
||||
protected $item;
|
||||
|
||||
protected $return_page;
|
||||
|
||||
protected $state;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
|
||||
// Get model data.
|
||||
$this->state = $this->get('State');
|
||||
$this->item = $this->get('Item');
|
||||
$this->form = $this->get('Form');
|
||||
$this->return_page = $this->get('ReturnPage');
|
||||
|
||||
if (empty($this->item->id))
|
||||
{
|
||||
$authorised = $user->authorise('core.create', 'com_content') || (count($user->getAuthorisedCategories('com_content', 'core.create')));
|
||||
}
|
||||
else
|
||||
{
|
||||
$authorised = $this->item->params->get('access-edit');
|
||||
}
|
||||
|
||||
if ($authorised !== true)
|
||||
{
|
||||
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->item->tags = new JHelperTags;
|
||||
if (!empty($this->item->id))
|
||||
{
|
||||
$this->item->tags->getItemTags('com_content.article.', $this->item->id);
|
||||
}
|
||||
if (!empty($this->item) && isset($this->item->id))
|
||||
{
|
||||
$this->item->images = json_decode($this->item->images);
|
||||
$this->item->urls = json_decode($this->item->urls);
|
||||
|
||||
$tmp = new stdClass;
|
||||
$tmp->images = $this->item->images;
|
||||
$tmp->urls = $this->item->urls;
|
||||
$this->form->bind($tmp);
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
JError::raiseWarning(500, implode("\n", $errors));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create a shortcut to the parameters.
|
||||
$params = &$this->state->params;
|
||||
|
||||
//Escape strings for HTML output
|
||||
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
|
||||
|
||||
$this->params = $params;
|
||||
$this->user = $user;
|
||||
|
||||
if ($params->get('enable_category') == 1)
|
||||
{
|
||||
$this->form->setFieldAttribute('catid', 'default', $params->get('catid', 1));
|
||||
$this->form->setFieldAttribute('catid', 'readonly', 'true');
|
||||
}
|
||||
$this->_prepareDocument();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*/
|
||||
protected function _prepareDocument()
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$menus = $app->getMenu();
|
||||
$title = null;
|
||||
|
||||
// Because the application sets a default page title,
|
||||
// we need to get it from the menu item itself
|
||||
$menu = $menus->getActive();
|
||||
if ($menu)
|
||||
{
|
||||
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->params->def('page_heading', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE'));
|
||||
}
|
||||
|
||||
$title = $this->params->def('page_title', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE'));
|
||||
if ($app->getCfg('sitename_pagetitles', 0) == 1)
|
||||
{
|
||||
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
|
||||
}
|
||||
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
|
||||
{
|
||||
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
|
||||
}
|
||||
$this->document->setTitle($title);
|
||||
|
||||
$pathway = $app->getPathWay();
|
||||
$pathway->addItem($title, '');
|
||||
|
||||
if ($this->params->get('menu-meta_description'))
|
||||
{
|
||||
$this->document->setDescription($this->params->get('menu-meta_description'));
|
||||
}
|
||||
|
||||
if ($this->params->get('menu-meta_keywords'))
|
||||
{
|
||||
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
|
||||
}
|
||||
|
||||
if ($this->params->get('robots'))
|
||||
{
|
||||
$this->document->setMetadata('robots', $this->params->get('robots'));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user