2016-01-30 20:28:43 +00:00
< ? php
2018-05-18 06:28:27 +00:00
/**
* @ package Joomla . Component . Builder
*
* @ created 30 th April , 2015
* @ author Llewellyn van der Merwe < http :// www . joomlacomponentbuilder . com >
* @ github Joomla Component Builder < https :// github . com / vdm - io / Joomla - Component - Builder >
2019-02-23 13:28:54 +00:00
* @ copyright Copyright ( C ) 2015 - 2019 Vast Development Method . All rights reserved .
2018-05-18 06:28:27 +00:00
* @ license GNU General Public License version 2 or later ; see LICENSE . txt
*/
2016-01-30 20:28:43 +00:00
// No direct access to this file
defined ( '_JEXEC' ) or die ( 'Restricted access' );
// set the defaults
2019-10-16 20:34:36 +00:00
$items = $displayData -> vyifields ;
2018-08-18 12:09:17 +00:00
$user = JFactory :: getUser ();
$id = $displayData -> item -> id ;
// set the edit URL
2017-12-12 13:18:27 +00:00
$edit = " index.php?option=com_componentbuilder&view=fields&task=field.edit " ;
2018-08-18 12:09:17 +00:00
// set a return value
$return = ( $id ) ? " index.php?option=com_componentbuilder&view=fieldtype&layout=edit&id= " . $id : " " ;
// check for a return value
$jinput = JFactory :: getApplication () -> input ;
if ( $_return = $jinput -> get ( 'return' , null , 'base64' ))
{
$return .= " &return= " . $_return ;
}
2019-03-04 12:47:28 +00:00
// check if return value was set
if ( ComponentbuilderHelper :: checkString ( $return ))
{
// set the referral values
$ref = ( $id ) ? " &ref=fieldtype&refid= " . $id . " &return= " . urlencode ( base64_encode ( $return )) : " &return= " . urlencode ( base64_encode ( $return ));
}
else
{
$ref = ( $id ) ? " &ref=fieldtype&refid= " . $id : " " ;
}
2018-08-18 12:09:17 +00:00
// set the create new URL
2019-03-04 12:47:28 +00:00
$new = " index.php?option=com_componentbuilder&view=fields&task=field.edit " . $ref ;
2018-08-18 12:09:17 +00:00
// set the create new and close URL
2019-03-04 12:47:28 +00:00
$close_new = " index.php?option=com_componentbuilder&view=fields&task=field.edit " ;
2018-08-18 12:09:17 +00:00
// load the action object
2017-12-12 13:18:27 +00:00
$can = ComponentbuilderHelper :: getActions ( 'field' );
2016-01-30 20:28:43 +00:00
?>
< div class = " form-vertical " >
< ? php if ( $can -> get ( 'field.create' )) : ?>
2018-08-18 12:09:17 +00:00
< div class = " btn-group " >
< a class = " btn btn-small btn-success " href = " <?php echo $new ; ?> " >< span class = " icon-new icon-white " ></ span > < ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_NEW' ); ?> </a>
< a class = " btn btn-small " onclick = " Joomla.submitbutton('fieldtype.cancel'); " href = " <?php echo $close_new ; ?> " >< span class = " icon-new " ></ span > < ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_CLOSE_NEW' ); ?> </a>
</ div >< br />< br />
2016-01-30 20:28:43 +00:00
< ? php endif ; ?>
< ? php if ( ComponentbuilderHelper :: checkArray ( $items )) : ?>
2016-05-07 01:12:30 +00:00
< table class = " footable table data fields " data - show - toggle = " true " data - toggle - column = " first " data - sorting = " true " data - paging = " true " data - paging - size = " 20 " data - filtering = " true " >
2016-01-30 20:28:43 +00:00
< thead >
< tr >
2016-05-07 01:12:30 +00:00
< th data - type = " html " data - sort - use = " text " >
2016-01-30 20:28:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_NAME_LABEL' ); ?>
</ th >
2016-05-07 01:12:30 +00:00
< th data - breakpoints = " xs sm " data - type = " html " data - sort - use = " text " >
2016-03-04 00:01:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL' ); ?>
2016-01-30 20:28:43 +00:00
</ th >
2016-05-07 01:12:30 +00:00
< th data - breakpoints = " xs sm " data - type = " html " data - sort - use = " text " >
2016-01-30 20:28:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL' ); ?>
</ th >
2016-05-07 01:12:30 +00:00
< th data - breakpoints = " xs sm md " data - type = " html " data - sort - use = " text " >
2016-01-30 20:28:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL' ); ?>
</ th >
2016-05-07 01:12:30 +00:00
< th data - breakpoints = " xs sm md " data - type = " html " data - sort - use = " text " >
2016-01-30 20:28:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL' ); ?>
</ th >
2016-05-07 01:12:30 +00:00
< th data - breakpoints = " xs sm md " data - type = " html " data - sort - use = " text " >
2018-04-13 15:24:06 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_STORE_LABEL' ); ?>
2016-01-30 20:28:43 +00:00
</ th >
2016-05-07 01:12:30 +00:00
< th data - breakpoints = " all " data - type = " html " data - sort - use = " text " >
2019-10-14 15:30:35 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES' ); ?>
2016-01-30 20:28:43 +00:00
</ th >
2016-05-07 01:12:30 +00:00
< th width = " 10 " data - breakpoints = " xs sm md " >
2016-01-30 20:28:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_STATUS' ); ?>
</ th >
2016-05-07 01:12:30 +00:00
< th width = " 5 " data - type = " number " data - breakpoints = " xs sm md " >
2016-01-30 20:28:43 +00:00
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_FIELD_ID' ); ?>
</ th >
</ tr >
</ thead >
< tbody >
< ? php foreach ( $items as $i => $item ) : ?>
< ? php
$canCheckin = $user -> authorise ( 'core.manage' , 'com_checkin' ) || $item -> checked_out == $user -> id || $item -> checked_out == 0 ;
$userChkOut = JFactory :: getUser ( $item -> checked_out );
$canDo = ComponentbuilderHelper :: getActions ( 'field' , $item , 'fields' );
?>
< tr >
2018-05-24 13:56:56 +00:00
< td >
2016-01-30 20:28:43 +00:00
< ? php if ( $canDo -> get ( 'field.edit' )) : ?>
2018-08-18 12:09:17 +00:00
< a href = " <?php echo $edit ; ?>&id=<?php echo $item->id ; ?><?php echo $ref ; ?> " >< ? php echo $displayData -> escape ( $item -> name ); ?> </a>
2018-05-24 13:56:56 +00:00
< ? php if ( $item -> checked_out ) : ?>
< ? php echo JHtml :: _ ( 'jgrid.checkedout' , $i , $userChkOut -> name , $item -> checked_out_time , 'fields.' , $canCheckin ); ?>
< ? php endif ; ?>
2016-01-30 20:28:43 +00:00
< ? php else : ?>
2018-05-24 13:56:56 +00:00
< ? php echo $displayData -> escape ( $item -> name ); ?>
2016-01-30 20:28:43 +00:00
< ? php endif ; ?>
</ td >
< td >
2016-03-04 00:01:43 +00:00
< ? php echo $displayData -> escape ( $item -> fieldtype_name ); ?>
2016-01-30 20:28:43 +00:00
</ td >
< td >
< ? php echo JText :: _ ( $item -> datatype ); ?>
</ td >
< td >
< ? php echo JText :: _ ( $item -> indexes ); ?>
</ td >
< td >
< ? php echo JText :: _ ( $item -> null_switch ); ?>
</ td >
2018-04-13 15:24:06 +00:00
< td >
< ? php echo JText :: _ ( $item -> store ); ?>
</ td >
2018-05-24 13:56:56 +00:00
< td >
2016-01-30 20:28:43 +00:00
< ? php if ( $user -> authorise ( 'core.edit' , 'com_componentbuilder.fields.category.' . ( int ) $item -> catid )) : ?>
< a href = " index.php?option=com_categories&task=category.edit&id=<?php echo (int) $item->catid ; ?>&extension=com_componentbuilder.fields " >< ? php echo $displayData -> escape ( $item -> category_title ); ?> </a>
< ? php else : ?>
< ? php echo $displayData -> escape ( $item -> category_title ); ?>
< ? php endif ; ?>
</ td >
< ? php if ( $item -> published == 1 ) : ?>
2016-05-07 01:12:30 +00:00
< td class = " center " data - sort - value = " 1 " >
2017-10-30 13:08:02 +00:00
< span class = " status-metro status-published " title = " <?php echo JText::_('COM_COMPONENTBUILDER_PUBLISHED'); ?> " >
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_PUBLISHED' ); ?>
2016-01-30 20:28:43 +00:00
</ span >
</ td >
< ? php elseif ( $item -> published == 0 ) : ?>
2016-05-07 01:12:30 +00:00
< td class = " center " data - sort - value = " 2 " >
2017-10-30 13:08:02 +00:00
< span class = " status-metro status-inactive " title = " <?php echo JText::_('COM_COMPONENTBUILDER_INACTIVE'); ?> " >
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_INACTIVE' ); ?>
2016-01-30 20:28:43 +00:00
</ span >
</ td >
< ? php elseif ( $item -> published == 2 ) : ?>
2016-05-07 01:12:30 +00:00
< td class = " center " data - sort - value = " 3 " >
2017-10-30 13:08:02 +00:00
< span class = " status-metro status-archived " title = " <?php echo JText::_('COM_COMPONENTBUILDER_ARCHIVED'); ?> " >
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_ARCHIVED' ); ?>
2016-01-30 20:28:43 +00:00
</ span >
</ td >
< ? php elseif ( $item -> published == - 2 ) : ?>
2016-05-07 01:12:30 +00:00
< td class = " center " data - sort - value = " 4 " >
2017-10-30 13:08:02 +00:00
< span class = " status-metro status-trashed " title = " <?php echo JText::_('COM_COMPONENTBUILDER_TRASHED'); ?> " >
< ? php echo JText :: _ ( 'COM_COMPONENTBUILDER_TRASHED' ); ?>
2016-01-30 20:28:43 +00:00
</ span >
</ td >
< ? php endif ; ?>
< td class = " nowrap center hidden-phone " >
< ? php echo $item -> id ; ?>
</ td >
</ tr >
< ? php endforeach ; ?>
</ tbody >
</ table >
< ? php else : ?>
< div class = " alert alert-no-items " >
< ? php echo JText :: _ ( 'JGLOBAL_NO_MATCHING_RESULTS' ); ?>
</ div >
< ? php endif ; ?>
</ div >