コード例 #1
0
ファイル: view.html.php プロジェクト: kolydart/SEBLOD
 function display($tpl = null)
 {
     switch ($this->getlayout()) {
         case 'delete':
             $this->prepareDelete();
             break;
         case 'edit':
         case 'error':
             $this->prepareDisplay();
             break;
         case 'edit2':
             $this->prepareDisplay();
             $this->prepareDisplay_Ajax();
             break;
         default:
             break;
     }
     if (JCck::on()) {
         $this->css = array('_' => '', 'panel_height' => '89px', 'w30' => 'span4', 'w70' => 'span8', 'wrapper' => 'container', 'wrapper2' => 'row-fluid', 'wrapper_tmpl' => 'span');
         $this->js = array('_' => '', 'tooltip' => '$(".hasTooltip").tooltip({});');
     } else {
         $this->css = array('_' => '', 'panel_height' => '65px', 'w30' => 'width-30', 'w70' => 'width-70 fltlft', 'wrapper' => 'sebwrapper', 'wrapper2' => 'seb-wrapper workshop', 'wrapper_tmpl' => 'width-100 bg-dark fltlft');
         $this->js = array('_' => '', 'tooltip' => '');
     }
     $this->uix = 'full';
     parent::display($tpl);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: densem-2013/exikom
 public function prepareToolbar()
 {
     Helper_Admin::addToolbar($this->vName, $this->vTitle, $this->state->get('filter.folder'));
     if (JCck::on()) {
         JHtmlSidebar::setAction('index.php?option=com_cck&view=templates');
     }
 }
コード例 #3
0
ファイル: integration.php プロジェクト: codigoaberto/SEBLOD
 public static function onCCK_Storage_LocationAfterRender(&$buffer, &$data, $uri = array())
 {
     $app = JFactory::getApplication();
     if ($uri['layout']) {
         return;
     }
     if ($uri['view'] == 'featured') {
         $data['return_view'] = 'featured';
         $tag = '&return=featured';
     } else {
         $data['return_view'] = '';
         $tag = '';
     }
     $class = JCck::on('3.4') ? ' class="hasTooltip"' : '';
     $data['doIntegration'] = false;
     $data['multilanguage'] = $data['options']->get('multilanguage', 0);
     if ($data['multilanguage']) {
         $data['search'] = '#<a' . $class . ' href="(.*)index.php\\?option=com_content&amp;task=article.edit' . $tag . '&amp;id=([0-9]*)" (.*)>#U';
     } else {
         $data['search'] = '#<a' . $class . ' href="(.*)index.php\\?option=com_content&amp;task=article.edit' . $tag . '&amp;id=([0-9]*)"#';
     }
     $data['search_alt'] = '#<a href = "javascript://" onclick="listItemTask\\(\'cb([0-9]*)\', \'articles.archive\'\\)">(.*)</a>#sU';
     if (JCckDevHelper::hasLanguageAssociations() && $data['multilanguage']) {
         $query = 'SELECT a.pk, a.cck, b.key, c.language FROM #__cck_core AS a' . ' LEFT JOIN #__associations AS b ON ( b.id = a.pk AND context = "com_content.item" )' . ' LEFT JOIN #__content AS c ON c.id = a.pk' . ' WHERE storage_location="joomla_article"';
         $list_assoc = JCckDatabase::loadObjectListArray('SELECT a.id, a.key, b.language FROM #__associations AS a LEFT JOIN #__content AS b ON ( b.id = a.id AND a.context = "com_content.item" )', 'key', 'language');
     } else {
         $query = 'SELECT pk, cck FROM #__cck_core WHERE storage_location="joomla_article"';
         $list_assoc = array();
     }
     $list = JCckDatabase::loadObjectList($query, 'pk');
     $buffer = JCckDevIntegration::rewriteBuffer($buffer, $data, $list, $list_assoc);
 }
コード例 #4
0
ファイル: toolbox.php プロジェクト: kolydart/SEBLOD
 public static function setHead(&$head)
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     if (isset($app->cck_document)) {
         if (isset($app->cck_document['styleSheets']) && count($app->cck_document['styleSheets'])) {
             foreach ($app->cck_document['styleSheets'] as $k => $v) {
                 $head['styleSheets'][$k] = $v;
             }
             if (JCck::on()) {
                 $doc->setHeadData(array('styleSheets' => $head['styleSheets']));
             } else {
                 $doc->_styleSheets = $head['styleSheets'];
             }
         }
         if (isset($app->cck_document['scripts']) && count($app->cck_document['scripts'])) {
             foreach ($app->cck_document['scripts'] as $k => $v) {
                 $head['scripts'][$k] = $v;
             }
             if (JCck::on()) {
                 $doc->setHeadData(array('scripts' => $head['scripts']));
             } else {
                 $doc->_scripts = $head['scripts'];
             }
         }
     }
 }
コード例 #5
0
ファイル: view.html.php プロジェクト: densem-2013/exikom
 function display($tpl = NULL)
 {
     $app = JFactory::getApplication();
     $this->item = new stdClass();
     $this->state = $this->get('State');
     $this->option = $app->input->get('option', '');
     $this->file = $this->state->get('file', '');
     $this->item->id = $this->state->get('bx.id', '');
     $this->item->name = $this->state->get('bx.name', '');
     $this->item->alt = $this->state->get('alt', 0);
     if ($this->getLayout() != 'raw') {
         $this->function = $this->state->get('function', '');
         $this->item->title = $this->state->get('bx.title', '');
         $this->item->type = $this->state->get('bx.type', '');
         $this->item->params = $this->state->get('bx.params', '');
         $this->doValidation = $this->state->get('validation', 0);
     }
     if (JCck::on()) {
         $this->css = array('items' => 'seblod-manager', 'table' => 'table table-striped', 'wrapper_tmpl' => 'span12');
     } else {
         $this->css = array('items' => 'seblod', 'table' => 'adminlist', 'wrapper_tmpl' => 'width-100 bg-dark fltlft');
     }
     JFactory::getApplication()->input->set('hidemainmenu', true);
     parent::display($tpl);
 }
コード例 #6
0
ファイル: form.php プロジェクト: codigoaberto/SEBLOD
 public function prepareUI()
 {
     if (JCck::on()) {
         $this->css = array('w30' => 'span4', 'w70' => 'span8', 'wrapper' => 'container', 'wrapper2' => 'row-fluid', 'wrapper_tmpl' => 'span');
     } else {
         $this->css = array('w30' => 'width-30', 'w70' => 'width-70 fltlft', 'wrapper' => 'sebwrapper', 'wrapper2' => 'seb-wrapper', 'wrapper_tmpl' => 'width-100 bg-dark fltlft');
     }
 }
コード例 #7
0
ファイル: view.php プロジェクト: densem-2013/exikom
 protected function prepareUI()
 {
     if (JCck::on()) {
         $this->css = array('items' => 'seblod-manager', 'table' => 'table table-striped', 'w33' => 'span4', 'w50' => 'span6', 'w66' => 'span8', 'w100' => 'span12', 'wrapper' => 'row-fluid');
     } else {
         $this->css = array('items' => 'seblod', 'table' => 'adminlist', 'w33' => 'width-30', 'w50' => 'width-50 fltlft', 'w66' => 'width-100', 'w100' => 'width-100', 'wrapper' => 'sebwrapper');
     }
 }
コード例 #8
0
ファイル: cckexport.php プロジェクト: hamby/SEBLOD
 protected function _getHTML($text, $url, $class = '')
 {
     if (JCck::on()) {
         $html = '<a href="' . $url . '" class="btn' . $class . '">' . '<span class="icon-download"></span>' . "\n" . $text . '</a>';
     } else {
         $html = '<a href="' . $url . '">' . $text . ' &dArr;</a>';
     }
     return $html;
 }
コード例 #9
0
ファイル: list.php プロジェクト: hamby/SEBLOD
 public function prepareUI()
 {
     if (JCck::on()) {
         $this->css = array('batch' => 'modal modal-small hide fade', 'filter' => 'btn-toolbar', 'filter_search' => 'filter-search btn-group pull-left hidden-phone input-append', 'filter_search_button' => 'tip hasTooltip', 'filter_search_buttons' => 'btn-group pull-left hidden-phone', 'filter_search_list' => 'pull-right hidden-phone', 'filter_select' => 'filter-select hidden-phone hidden-important', 'items' => 'seblod-manager clearfix', 'joomla3' => ' hide', 'table' => 'table table-striped', 'w50' => 'span6', 'wrapper' => 'row-fluid');
         $this->html = array('filter_select_header' => '<h4 class="page-header">' . JText::_('JSEARCH_FILTER_LABEL') . '</h4>', 'filter_select_header_custom' => '<h4 class="page-header">*title*</h4>', 'filter_select_separator' => '<hr class="hr-condensed" />');
         $this->js = array('filter' => 'jQuery(document).ready(function($) { $("#sidebar div.sidebar-nav").append("<hr />"); $("div.filter-select").appendTo("#sidebar div.sidebar-nav").removeClass("hidden-important");' . 'var w = $("div.sidebar-nav").width()-28; $("div.filter-select,div.sidebar-nav div.chzn-container").css("width",w+"px"); $("div.sidebar-nav div.chzn-drop").css("width",(w)+"px");  $("div.sidebar-nav div.chzn-search > input").css("width",(w-10)+"px"); });');
         $this->sidebar = JHtmlSidebar::render();
     } else {
         $this->css = array('batch' => 'seblod', 'filter' => 'seblod first', 'filter_search' => 'filter-search fltlft', 'filter_search_button' => 'inputbutton', 'filter_search_buttons' => 'filter-search fltlft', 'filter_search_list' => 'hide', 'filter_select' => 'filter-select fltrt', 'items' => 'seblod', 'joomla3' => '', 'table' => 'adminlist', 'w50' => 'width-50 fltlft', 'wrapper' => 'sebwrapper');
         $this->html = array('filter_select_header' => '', 'filter_select_header_custom' => '', 'filter_select_separator' => '');
         $this->js = array('filter' => '');
     }
 }
コード例 #10
0
 public static function addLavalamp($elem, $js = '')
 {
     if (JCck::on()) {
         return;
     }
     $doc = JFactory::getDocument();
     $doc->addStyleSheet(JROOT_MEDIA_CCK . '/scripts/jquery-lavalamp/css/lavalamp.css');
     $doc->addScript(JROOT_MEDIA_CCK . '/scripts/jquery-lavalamp/js/jquery.easing.min.js');
     $doc->addScript(JROOT_MEDIA_CCK . '/scripts/jquery-lavalamp/js/jquery.lavalamp.min.js');
     if ($js != '') {
         $js .= ' ';
     }
     $js = 'jQuery(document).ready(function($){ ' . $js . '$("' . $elem . '").lavaLamp({ fx: "easeOutBack", speed: 888, }); });';
     $doc->addScriptDeclaration($js);
 }
コード例 #11
0
ファイル: view.html.php プロジェクト: kolydart/SEBLOD
 protected function prepareToolbar()
 {
     $bar = JToolBar::getInstance('toolbar');
     $canDo = Helper_Admin::getActions();
     if (JCck::on()) {
         JToolBarHelper::title(CCK_LABEL, 'cck-seblod');
     } else {
         JToolBarHelper::title('&nbsp;', 'seblod.png');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences(CCK_COM, 560, 840, 'JTOOLBAR_OPTIONS');
     }
     Helper_Admin::addToolbarHistoryButton();
     // Helper_Admin::addToolbarSupportButton();
 }
コード例 #12
0
ファイル: helper.php プロジェクト: codigoaberto/SEBLOD
 public static function &getButtons()
 {
     $uix = JCck::getUIX();
     if (empty(self::$buttons)) {
         if ($uix == 'compact') {
             self::$buttons = array(array('link' => JRoute::_('index.php?option=com_cck&view=types'), 'icon' => 'icon-48-types.png', 'image' => 'cck-form', 'label' => JText::_('MOD_CCK_QUICKICON_FORM_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_FORM_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION'), array('link' => JRoute::_('index.php?option=com_cck&view=folders'), 'icon' => 'icon-48-folders.png', 'image' => 'cck-application', 'label' => JText::_('MOD_CCK_QUICKICON_APP_FOLDER_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_APP_FOLDER_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION'), array('link' => JRoute::_('http://www.seblod.com/products'), 'target' => '_blank', 'icon' => 'icon-48-seblod.png', 'image' => 'cck-products', 'label' => JText::_('MOD_CCK_QUICKICON_SEBLOD_MARKET'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_SEBLOD_MARKET_EXTEND')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_SEBLOD_MARKET'));
         } else {
             self::$buttons = array(array('link' => JRoute::_('index.php?option=com_cck&view=types'), 'icon' => 'icon-48-types.png', 'image' => 'cck-form', 'label' => JText::_('MOD_CCK_QUICKICON_CONTENT_TYPE_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_CONTENT_TYPE_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION'), array('link' => JRoute::_('index.php?option=com_cck&view=fields'), 'icon' => 'icon-48-fields.png', 'image' => 'cck-plugin', 'label' => JText::_('MOD_CCK_QUICKICON_FIELD_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_FIELD_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION'), array('link' => JRoute::_('index.php?option=com_cck&view=searchs'), 'icon' => 'icon-48-searchs.png', 'image' => 'cck-search', 'label' => JText::_('MOD_CCK_QUICKICON_SEARCH_TYPE_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_SEARCH_TYPE_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION'), array('link' => JRoute::_('index.php?option=com_cck&view=templates'), 'icon' => 'icon-48-templates.png', 'image' => 'cck-template', 'label' => JText::_('MOD_CCK_QUICKICON_TEMPLATE_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_TEMPLATE_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION'));
             if (!JCck::on()) {
                 self::$buttons[] = array('link' => JRoute::_('index.php?option=com_cck&view=folders'), 'icon' => 'icon-48-folders.png', 'image' => 'cck-application', 'label' => JText::_('MOD_CCK_QUICKICON_APP_FOLDER_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_APP_FOLDER_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION');
                 self::$buttons[] = array('link' => JRoute::_('index.php?option=com_cck&view=sites'), 'icon' => 'icon-48-sites.png', 'image' => 'cck-multisite', 'label' => JText::_('MOD_CCK_QUICKICON_SITE_MANAGER'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_SITE_MANAGER')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_CONSTRUCTION');
             }
             self::$buttons[] = array('link' => JRoute::_('http://www.seblod.com/products'), 'target' => '_blank', 'icon' => 'icon-48-seblod.png', 'image' => 'cck-products', 'label' => JText::_('MOD_CCK_QUICKICON_SEBLOD_MARKET'), 'text' => str_replace('<br />', ' ', JText::_('MOD_CCK_QUICKICON_SEBLOD_MARKET_EXTEND')), 'access' => array('core.manage', 'com_cck'), 'group' => 'MOD_CCK_QUICKICON_SEBLOD_MARKET');
         }
     }
     return self::$buttons;
 }
コード例 #13
0
ファイル: include.php プロジェクト: densem-2013/exikom
 public static function addTooltip($elem = '', $pos_my = 'top left', $pos_at = 'bottom right', $classes = '', $script = true, $tmpl = '')
 {
     if (!JCck::on()) {
         $doc = JFactory::getDocument();
         if ($script === true) {
             $doc->addStyleSheet(JROOT_MEDIA_CCK . '/scripts/jquery-qtip/css/jquery.qtip.css');
             $doc->addScript(JROOT_MEDIA_CCK . '/scripts/jquery-qtip/js/jquery.qtip.min.js');
         }
         if ($elem) {
             $js = 'jQuery(document).ready(function($){ $("' . $elem . '").qtip({ style: {classes: "' . $classes . '"}, position: {my: "' . $pos_my . '", at: "' . $pos_at . '"} }); });';
             if ($tmpl == 'ajax') {
                 echo '<script type="text/javascript">' . $js . '</script>';
             } else {
                 $doc->addScriptDeclaration($js);
             }
         }
     }
 }
コード例 #14
0
 public static function addDependencies($view, $layout, $tmpl = '')
 {
     $doc = JFactory::getDocument();
     $script = $tmpl == 'ajax' ? false : true;
     Helper_Include::addStyleSheets(true);
     // Additional
     switch ($view) {
         case 'box':
             JCck::loadjQuery(true, true, array('cck.dev-3.6.0.min.js', 'jquery.ui.effects.min.js', 'jquery.json.min.js'));
             Helper_Include::addSmoothScrool(500);
             break;
         case 'folder':
             JCck::loadjQuery(true, true, true);
             break;
         case 'template':
             JCck::loadjQuery(true, true, true);
             Helper_Include::addJSTree('cck_tree', $script);
             break;
         case 'site':
             JCck::loadjQuery(true, true, true);
             break;
         case 'field':
             if ($script === true) {
                 JCck::loadjQuery(true, true, array('cck.dev-3.6.0.min.js'));
                 JCck::loadjQueryUI();
             }
             Helper_Include::addTooltip('span[title].qtip_cck', 'left center', 'right center', 'ui-tooltip-cck-indigo_dye ui-tooltip-shadow', $script, $tmpl);
             Helper_Include::addTooltip('img[title].qtip_cck', 'right center', 'left center', 'ui-tooltip-cck-indigo_dye ui-tooltip-shadow', false, $tmpl);
             break;
         case 'type':
         case 'search':
             if ($script === true) {
                 JCck::loadjQuery(true, true, array('cck.dev-3.6.0.min.js', 'jquery.biscuit.min.js'));
                 JCck::loadjQueryUI();
                 $doc->addStyleSheet(JROOT_CCK . '/administrator/components/com_' . CCK_NAME . '/assets/css/ui-construction.css');
                 $doc->addStyleSheet(JROOT_CCK . '/administrator/components/com_' . CCK_NAME . '/assets/styles/seblod/ui-construction.css');
             }
             Helper_Include::addColorbox_Live('930', '550', $script, 'cbox', ', onLoad: function(){ $("#cboxClose").remove();}');
             Helper_Include::addColorpicker($script);
             Helper_Include::addTooltip('', '', '', '', $script);
             break;
         case 'session':
         case 'version':
             JCck::loadjQuery(true, true, true);
             break;
             // --------
         // --------
         case 'templates':
         case 'types':
         case 'fields':
         case 'searchs':
         case 'folders':
         case 'sites':
         case 'variations':
         case 'sessions':
         case 'versions':
             if ($view == 'folders') {
                 JCck::loadjQuery(true, true, array('cck.dev-3.6.0.min.js'));
             } else {
                 JCck::loadjQuery();
             }
             if (JCck::on()) {
                 JHtml::_('bootstrap.tooltip');
                 JHtml::_('formbehavior.chosen', 'select:not(.no-chosen)');
             }
             Helper_Include::addLavalamp('#submenu');
             Helper_Include::addSmoothScrool();
             if ($view == 'fields') {
                 Helper_Include::addColorbox('500', '300', $script, 'cbox', ', onLoad: function(){ $("#cboxClose").remove();}');
             } elseif ($view == 'templates') {
                 Helper_Include::addColorbox('850', '585', $script, 'cbox', ', scrolling:false, onLoad: function(){ $("#cboxClose").remove();}');
             } elseif ($view == 'types' || $view == 'searchs') {
                 Helper_Include::addColorbox('850', '430', true, 'cbox_button', ', scrolling:false');
             } elseif ($view == 'variations') {
                 JHtml::_('behavior.framework', false);
             }
             if ($view == 'searchs' || $view == 'sites') {
                 $doc->addStyleSheet(JROOT_MEDIA_CCK . '/css/jquery.sly.css');
                 $doc->addScript(JROOT_MEDIA_CCK . '/js/jquery.sly.min.js');
             }
             if ($view == 'sessions') {
                 $doc->addStyleDeclaration('#system-message-container.j-toggle-main.span10{width: 100%;}');
             }
             break;
         case 'list':
             JHtml::_('formbehavior.chosen', 'select:not(.no-chosen)');
             break;
         case 'cck':
             $doc->addStyleSheet(JROOT_CCK . '/administrator/components/com_' . CCK_NAME . '/assets/css/cpanel.css');
             JCck::loadjQuery();
             Helper_Include::addColorbox('930', '430', true, 'cbox_button');
             Helper_Include::addLavalamp('#submenu');
             break;
         default:
             break;
     }
 }
コード例 #15
0
ファイル: default.php プロジェクト: hamby/SEBLOD
/**
* @version 			SEBLOD 3.x Core ~ $Id: default.php sebastienheraud $
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2009 - 2016 SEBLOD. All Rights Reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined('_JEXEC') or die;
$doc = JFactory::getDocument();
$user = JFactory::getUser();
$userId = $user->id;
$listOrder = $this->state->get('list.ordering');
$listDir = $this->state->get('list.direction');
$title2 = JText::_('COM_CCK_DOWNLOAD_THIS_VARIATION');
$top = !JCck::on() ? 'border-top' : 'content';
$config = JCckDev::init(array('42', 'button_submit', 'select_simple', 'text'), true, array('vName' => $this->vName));
$cck = JCckDev::preload(array('core_filter_input', 'core_filter_go', 'core_filter_search', 'core_filter_clear', 'core_location_filter'));
JText::script('COM_CCK_CONFIRM_DELETE');
Helper_Include::addDependencies($this->getName(), $this->getLayout());
?>

<form action="<?php 
echo JRoute::_('index.php?option=' . $this->option . '&view=' . $this->getName());
?>
" method="post" id="adminForm" name="adminForm">
<?php 
if (!empty($this->sidebar)) {
    ?>
	<div id="j-sidebar-container" class="span2">
		<?php 
コード例 #16
0
 public function onCCK_FieldPrepareSearch(&$field, $value = '', &$config = array(), $inherit = array(), $return = false)
 {
     if (self::$type != $field->type) {
         return;
     }
     self::$path = parent::g_getPath(self::$type . '/');
     parent::g_onCCK_FieldPrepareForm($field, $config);
     // Init
     $options2 = JCckDev::fromJSON($field->options2);
     if (count($inherit)) {
         $id = isset($inherit['id']) && $inherit['id'] != '' ? $inherit['id'] : $field->name;
         $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name;
     } else {
         $id = $field->name;
         $name = $field->name;
     }
     $value = trim($value) != '' ? trim($value) : trim($field->defaultvalue);
     if (trim($value) == '' || $value == '0000-00-00 00:00:00') {
         $Jdate = '';
         $value = '';
         $storedDate = '';
     } else {
         $options2['storage_format'] = isset($options2['storage_format']) ? $options2['storage_format'] : '0';
         $value = $options2['storage_format'] == '0' ? strtotime($value) : $value;
         $Jdate = date('Y-m-d H:i:s', $value);
         $storedDate = date('Ymd', $value);
         $value = date(@$options2['format'], $value);
     }
     $default_hour = @$options2['default_hour'];
     $default_min = @$options2['default_min'];
     $default_sec = @$options2['default_sec'];
     $format_jscal2 = self::_toJScal2Format(array('format' => @$options2['format'], 'default_hour' => $default_hour, 'default_min' => $default_min, 'default_sec' => $default_sec, 'time' => $options2['time']));
     $format_search = self::_toSearchFormat(array('format' => @$options2['format'], 'default_hour' => $default_hour, 'default_min' => $default_min, 'default_sec' => $default_sec, 'time' => $options2['time']));
     // Validate
     $validate = '';
     if ($config['doValidation'] > 1) {
         plgCCK_Field_ValidationRequired::onCCK_Field_ValidationPrepareForm($field, $id, $config);
         $validate = count($field->validate) ? ' validate[' . implode(',', $field->validate) . ']' : '';
     }
     // Prepare
     if (strpos($name, '[]') !== false) {
         //FieldX
         $nameH = substr($name, 0, -2);
         $form_more = '<input class="inputbox" type="hidden" id="' . $id . '" name="' . $nameH . '[]" value="' . $Jdate . '" />';
     } elseif ($name[strlen($name) - 1] == ']') {
         //GroupX
         $nameH = substr($name, 0, -1);
         $form_more = '<input class="inputbox" type="hidden" id="' . $id . '" name="' . $nameH . ']" value="' . $Jdate . '" />';
     } else {
         //Default
         $form_more = '<input class="inputbox" type="hidden" id="' . $id . '" name="' . $name . '" value="' . $Jdate . '" />';
     }
     $class = 'inputbox text' . $validate . ($field->css ? ' ' . $field->css : '');
     $maxlen = $field->maxlength > 0 ? ' maxlength="' . $field->maxlength . '"' : '';
     $readonly = $field->bool2 ? '' : ' readonly="readonly"';
     $attr = 'class="' . $class . '" size="' . $field->size . '"' . $readonly . $maxlen . ($field->attributes ? ' ' . $field->attributes : '');
     $form = '<input type="text" id="' . $id . '_hidden" name="' . $name . '_hidden" value="' . $value . '" ' . $attr . ' />' . $form_more;
     // Set
     if (!$field->variation) {
         if (JCck::on()) {
             $form .= '<button class="btn" id="' . $id . '_hidden-trigger"><span class="icon-calendar"></span></button>';
         } else {
             $form .= '<img src="' . self::$path . 'assets/images/calendar.png" alt="Calendar" class="calendar" id="' . $id . '_hidden-trigger" />';
         }
         $form .= self::_addScript($id, array('dateFormat' => $format_jscal2, 'time' => @$options2['time'], 'weekNumbers' => @$options2['week_numbers'], 'timePos' => @$options2['time_pos'], 'dates' => @$options2['dates'], 'storedDate' => $storedDate, 'default_hour' => $default_hour, 'default_min' => $default_min, 'default_sec' => $default_sec, 'type' => 'search', 'input_text' => $field->bool2));
         $field->form = $form;
         $field->markup_class .= ' input-append';
         self::_addScripts(array('theme' => @$options2['theme']));
     } else {
         parent::g_getDisplayVariation($field, $field->variation, $value, $value, $form, $id, $name, '<input', '', '', $config);
     }
     // Set
     $field->value = $Jdate == '' ? '' : date($format_search, strtotime($Jdate));
     // Return
     if ($return === true) {
         return $field;
     }
 }
コード例 #17
0
ファイル: script.php プロジェクト: kolydart/SEBLOD
 function postflight($type, $parent)
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     // Force { CCK } Plugins + { CCK } Library to be published
     $db->setQuery('UPDATE #__extensions SET enabled = 1 WHERE element = "cck"');
     $db->execute();
     // Rename Menu Item
     $db->setQuery('UPDATE #__menu SET alias = "SEBLOD 3.x", path="SEBLOD 3.x" WHERE link = "index.php?option=com_cck"');
     $db->execute();
     // Re-build menu
     $query = 'SELECT id, level, lft, path FROM #__menu WHERE link = "index.php?option=com_cck"';
     $db->setQuery($query);
     $seblod = $db->loadObject();
     if ($seblod->id > 0) {
         $query = 'SELECT extension_id as id, element FROM #__extensions WHERE type = "component" AND element LIKE "com_cck_%" ORDER BY name';
         $db->setQuery($query);
         $addons = $db->loadObjectList();
         if (count($addons)) {
             JLoader::register('JTableMenu', JPATH_PLATFORM . '/joomla/database/table/menu.php');
             $titles = array('com_cck_builder' => 'Builder', 'com_cck_developer' => 'Developer', 'com_cck_ecommerce' => 'eCommerce', 'com_cck_exporter' => 'Exporter', 'com_cck_importer' => 'Importer', 'com_cck_manager' => 'Manager', 'com_cck_multilingual' => 'Multilingual', 'com_cck_packager' => 'Packager', 'com_cck_toolbox' => 'Toolbox', 'com_cck_updater' => 'Updater', 'com_cck_webservices' => 'WebServices');
             foreach ($addons as $addon) {
                 $addon->title = $titles[$addon->element];
                 self::_addAddon($addon, $seblod);
             }
         }
     }
     // Reorder Plugins
     $i = 2;
     $ids = '';
     $query = 'SELECT extension_id FROM #__extensions WHERE type = "plugin" AND folder = "content" AND element != "cck" ORDER BY ordering';
     $db->setQuery($query);
     $plgs = $db->loadObjectList();
     $sql = 'UPDATE #__extensions SET ordering = CASE extension_id';
     foreach ($plgs as $p) {
         $ids .= $p->extension_id . ',';
         $sql .= ' WHEN ' . $p->extension_id . ' THEN ' . $i;
         $i++;
     }
     $ids = substr($ids, 0, -1);
     $sql .= ' END WHERE extension_id IN (' . $ids . ')';
     $db->setQuery($sql);
     $db->execute();
     $db->setQuery('UPDATE #__extensions SET ordering = 1 WHERE type = "plugin" AND folder = "content" AND element = "cck"');
     $db->execute();
     if ($type == 'install') {
         // Manage Modules
         $modules = array(0 => array('name' => 'mod_cck_menu', 'update' => 'title = "Admin Menu - SEBLOD", access = 3, published = 1, position = "menu", ordering = 2'), 1 => array('name' => 'mod_cck_quickadd', 'update' => 'title = "Quick Add - SEBLOD", access = 3, published = 1, position = "status", ordering = 0'), 2 => array('name' => 'mod_cck_quickicon', 'update' => 'title = "Quick Icons - SEBLOD", access = 3, published = 1, position = "icon", ordering = 2'), 3 => array('name' => 'mod_cck_breadcrumbs', 'update' => 'title = "Breadcrumbs - SEBLOD"'), 4 => array('name' => 'mod_cck_form', 'update' => 'title = "Form - SEBLOD"'), 5 => array('name' => 'mod_cck_list', 'update' => 'title = "List - SEBLOD"'), 6 => array('name' => 'mod_cck_search', 'update' => 'title = "Search - SEBLOD"'));
         foreach ($modules as $module) {
             $query = 'UPDATE #__modules SET ' . $module['update'] . ' WHERE module = "' . $module['name'] . '"';
             $db->setQuery($query);
             $db->execute();
             $query = 'SELECT id FROM #__modules WHERE module="' . $module['name'] . '"';
             $db->setQuery($query);
             $mid = $db->loadResult();
             $query = 'INSERT INTO #__modules_menu (moduleid, menuid) VALUES (' . $mid . ', 0)';
             $db->setQuery($query);
             $db->execute();
         }
         // Publish Plugins
         $query = 'UPDATE #__extensions SET enabled = 1 WHERE folder LIKE "cck_%"';
         $db->setQuery($query);
         $db->execute();
         // Revert Version for Joomla! 2.5.x
         if (!JCck::on()) {
             $query = 'SELECT id FROM #__cck_core_types WHERE version = 2 ORDER BY id';
             $db->setQuery($query);
             $forms = $db->loadObjectList();
             if (count($forms)) {
                 require_once JPATH_ADMINISTRATOR . '/components/com_cck/helpers/helper_version.php';
                 foreach ($forms as $f) {
                     Helper_Version::revert('type', $f->id, '1');
                 }
             }
         }
         // Set Template Styles
         $query = 'SELECT id FROM #__template_styles WHERE template="seb_one" ORDER BY id';
         $db->setQuery($query);
         $style = $db->loadResult();
         $query = 'SELECT id FROM #__template_styles WHERE template="seb_blog" ORDER BY id';
         $db->setQuery($query);
         $style2 = $db->loadResult();
         //
         $query = 'UPDATE #__cck_core_types SET template_admin = ' . $style . ', template_site = ' . $style . ', template_content = ' . $style . ', template_intro = ' . $style;
         $db->setQuery($query);
         $db->execute();
         //
         $query = 'UPDATE #__cck_core_searchs SET template_search = ' . $style . ', template_filter = ' . $style . ', template_list = ' . $style2 . ', template_item = ' . $style;
         $db->setQuery($query);
         $db->execute();
         // Add Categories
         $categories = array(0 => array('title' => 'Users', 'published' => '1', 'access' => '2', 'language' => '*', 'parent_id' => 1, 'plg_name' => 'joomla_user'), 1 => array('title' => 'User Groups', 'published' => '1', 'access' => '2', 'language' => '*', 'parent_id' => 1, 'plg_name' => 'joomla_user_group'));
         JLoader::register('JTableCategory', JPATH_PLATFORM . '/joomla/database/table/category.php');
         foreach ($categories as $category) {
             $table = JTable::getInstance('category');
             $table->access = 2;
             $table->setLocation(1, 'last-child');
             $table->bind($category);
             $rules = new JAccessRules('{"core.create":{"1":0},"core.delete":[],"core.edit":[],"core.edit.state":[],"core.edit.own":[]}');
             $table->setRules($rules);
             $table->check();
             $table->extension = 'com_content';
             $table->path .= $table->alias;
             $table->language = '*';
             $table->store();
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $dispatcher->trigger('onContentBeforeSave', array('', &$table, true));
             $table->store();
             $dispatcher->trigger('onContentAfterSave', array('', &$table, true));
             //
             $query = 'SELECT extension_id as id, params FROM #__extensions WHERE type="plugin" AND folder="cck_storage_location" AND element="' . $category['plg_name'] . '"';
             $db->setQuery($query);
             $plugin = $db->loadObject();
             $params = str_replace('"bridge_default-catid":"2"', '"bridge_default-catid":"' . $table->id . '"', $plugin->params);
             $query = 'UPDATE #__extensions SET params = "' . $db->escape($params) . '" WHERE extension_id = ' . (int) $plugin->id;
             $db->setQuery($query);
             $db->execute();
         }
         // Init Default Author
         $res = JCckDatabase::loadResult('SELECT id FROM #__users ORDER BY id ASC');
         $params = JComponentHelper::getParams('com_cck');
         $params->set('integration_user_default_author', (int) $res);
         $db->setQuery('UPDATE #__extensions SET params = "' . $db->escape($params) . '" WHERE name = "com_cck"');
         $db->execute();
         // Init ACL
         require_once JPATH_ADMINISTRATOR . '/components/com_cck/helpers/helper_admin.php';
         $pks = JCckDatabase::loadColumn('SELECT id FROM #__cck_core_folders ORDER BY lft');
         if (count($pks)) {
             $rules = '{"core.create":[],"core.delete":[],"core.delete.own":[],"core.edit":[],"core.edit.state":[],"core.edit.own":[]}';
             Helper_Admin::initACL(array('table' => 'folder', 'name' => 'folder', 'rules' => $rules), $pks);
         }
         $pks = JCckDatabase::loadColumn('SELECT id FROM #__cck_core_types ORDER BY id');
         if (count($pks)) {
             $rules = '{"core.create":[],"core.create.max.parent":{"8":0},"core.create.max.parent.author":{"8":0},"core.create.max.author":{"8":0},' . '"core.delete":[],"core.delete.own":[],"core.edit":[],"core.edit.own":[]}';
             $rules2 = array(8 => '{"core.create":{"1":1,"2":0},"core.create.max.parent":{"8":0},"core.create.max.parent.author":{"8":0},"core.create.max.author":{"8":0},' . '"core.delete":[],"core.delete.own":[],"core.edit":{"4":0},"core.edit.own":{"2":1}}');
             Helper_Admin::initACL(array('table' => 'type', 'name' => 'form', 'rules' => $rules), $pks, $rules2);
         }
     } else {
         $new = $app->cck_core_version;
         $old = $app->cck_core_version_old;
         $root = JPATH_ADMINISTRATOR . '/components/com_cck';
         require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/helpers/helper_folder.php';
         // ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** //
         $versions = array(0 => '2.0.0', 1 => '2.0.0.RC2', 2 => '2.0.0.RC2-1', 3 => '2.0.0.RC2-2', 4 => '2.0.0.RC2-3', 5 => '2.0.0.RC3', 6 => '2.0.0.RC4', 7 => '2.0.0.GA', 8 => '2.0.5', 9 => '2.0.6', 10 => '2.0.7', 11 => '2.1.0', 12 => '2.1.5', 13 => '2.2.0', 14 => '2.2.5', 15 => '2.3.0', 16 => '2.3.1', 17 => '2.3.5', 18 => '2.3.6', 19 => '2.3.7', 20 => '2.3.8', 21 => '2.3.9', 22 => '2.3.9.2', 23 => '2.4.5', 24 => '2.4.6', 25 => '2.4.7', 26 => '2.4.8', 27 => '2.4.8.5', 28 => '2.4.9', 29 => '2.4.9.1', 30 => '2.4.9.2', 31 => '2.4.9.5', 32 => '2.4.9.6', 33 => '2.4.9.7', 34 => '2.4.9.8', 35 => '2.5.0', 36 => '2.5.1', 37 => '2.5.2', 38 => '2.6.0', 39 => '2.7.0', 40 => '2.8.0', 41 => '2.9.0', 42 => '3.0.0', 43 => '3.0.1', 44 => '3.0.2', 45 => '3.0.3', 46 => '3.0.4', 47 => '3.0.5', 48 => '3.1.0', 49 => '3.1.1', 50 => '3.1.2', 51 => '3.1.3', 52 => '3.1.4', 53 => '3.1.5', 54 => '3.2.0', 55 => '3.2.1', 56 => '3.2.2', 57 => '3.3.0', 58 => '3.3.1', 59 => '3.3.2', 60 => '3.3.3', 61 => '3.3.4', 62 => '3.3.5', 63 => '3.3.6', 64 => '3.3.7', 65 => '3.3.8', 66 => '3.4.0', 67 => '3.4.1', 68 => '3.4.2', 69 => '3.4.3', 70 => '3.5.0', 71 => '3.5.1', 72 => '3.6.0', 73 => '3.6.1', 74 => '3.6.2', 75 => '3.6.3', 76 => '3.6.4', 77 => '3.6.5', 78 => '3.7.0', 79 => '3.7.1', 80 => '3.7.2', 81 => '3.7.3', 82 => '3.7.4', 83 => '3.7.5', 82 => '3.8.0');
         // ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** //
         $i = array_search($old, $versions);
         $i2 = $i;
         $n = array_search($new, $versions);
         if ($i < 7) {
             // ONLY < 2.0 GA
             $prefix = JFactory::getConfig()->get('dbprefix');
             $tables = JCckDatabase::loadColumn('SHOW TABLES');
             if (count($tables)) {
                 foreach ($tables as $table) {
                     if (strpos($table, $prefix . 'cck_item_') !== false) {
                         $replace = str_replace($prefix . 'cck_item_', $prefix . 'cck_store_item_', $table);
                         if ($replace) {
                             JCckDatabase::doQuery('ALTER TABLE ' . $table . ' RENAME ' . $replace);
                         }
                     } elseif (strpos($table, $prefix . 'cck_type_') !== false) {
                         $replace = str_replace($prefix . 'cck_type_', $prefix . 'cck_store_form_', $table);
                         if ($replace) {
                             JCckDatabase::doQuery('ALTER TABLE ' . $table . ' RENAME ' . $replace);
                         }
                     }
                 }
             }
             $fields = JCckDatabase::loadObjectList('SELECT id, storage_table FROM #__cck_core_fields WHERE storage_table LIKE "#__cck_item_%"');
             if (count($fields)) {
                 foreach ($fields as $field) {
                     $replace = str_replace('#__cck_item_', '#__cck_store_item_', $field->storage_table);
                     JCckDatabase::doQuery('UPDATE #__cck_core_fields SET storage_table = "' . $replace . '" WHERE id = ' . (int) $field->id);
                 }
             }
             $fields = JCckDatabase::loadObjectList('SELECT id, storage_table FROM #__cck_core_fields WHERE storage_table LIKE "#__cck_type_%"');
             if (count($fields)) {
                 foreach ($fields as $field) {
                     $replace = str_replace('#__cck_type_', '#__cck_store_form_', $field->storage_table);
                     JCckDatabase::doQuery('UPDATE #__cck_core_fields SET storage_table = "' . $replace . '" WHERE id = ' . (int) $field->id);
                 }
             }
             $fields = JCckDatabase::loadObjectList('SELECT id, options2 FROM #__cck_core_fields WHERE type = "select_dynamic"');
             if (count($fields)) {
                 foreach ($fields as $field) {
                     $options2 = $field->options2;
                     if (strpos($options2, '#__cck_item_') !== false) {
                         $options2 = str_replace('#__cck_item_', '#__cck_store_item_', $options2);
                     }
                     if (strpos($options2, '#__cck_type_') !== false) {
                         $options2 = str_replace('#__cck_type_', '#__cck_store_form_', $options2);
                     }
                     if ($options2 != $field->options2) {
                         JCckDatabase::doQuery('UPDATE #__cck_core_fields SET options2 = "' . $db->escape($options2) . '" WHERE id = ' . (int) $field->id);
                     }
                 }
             }
         }
         if ($i < 23) {
             // ONLY < 2.4.5
             JCckDatabase::doQuery('ALTER TABLE #__cck_core_folders ADD path VARCHAR( 1024 ) NOT NULL AFTER parent_id;');
             require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/helpers/helper_folder.php';
             $folders = JCckDatabase::loadColumn('SELECT id FROM #__cck_core_folders WHERE lft ORDER BY lft');
             foreach ($folders as $f) {
                 $path = Helper_Folder::getPath($f, '/');
                 JCckDatabase::doQuery('UPDATE #__cck_core_folders SET path = "' . $path . '" WHERE id = ' . (int) $f);
             }
             if (JCckDatabase::doQuery('INSERT IGNORE #__cck_core_folders (id) VALUES (29)')) {
                 require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/tables/folder.php';
                 $folder = JTable::getInstance('folder', 'CCK_Table');
                 $folder->load(29);
                 $folder_data = array('parent_id' => 13, 'path' => 'joomla/user/profile', 'title' => 'Profile', 'name' => 'profile', 'color' => '#0090d1', 'introchar' => 'U.', 'colorchar' => '#ffffff', 'elements' => 'field', 'featured' => 0, 'published' => 1);
                 $rules = new JAccessRules('{"core.create":[],"core.delete":[],"core.edit":[],"core.edit.state":[],"core.edit.own":[]}');
                 $folder->setRules($rules);
                 $folder->bind($folder_data);
                 $folder->store();
             }
         }
         for ($i = $i + 1; $i <= $n; $i++) {
             $file = $root . '/install/upgrades/' . strtolower($versions[$i]) . '.sql';
             if (JFile::exists($file)) {
                 $buffer = file_get_contents($file);
                 $queries = JInstallerHelper::splitSql($buffer);
                 foreach ($queries as $query) {
                     $query = trim($query);
                     if ($query != '' && $query[0] != '#') {
                         $db->setQuery($query);
                         $db->execute();
                     }
                 }
             }
         }
         if ($i2 < 23) {
             // ONLY < 2.4.5
             $bool = true;
             $live = JCckDatabase::loadObjectList('SELECT typeid, fieldid, client, live, live_value FROM #__cck_core_type_field WHERE live IN ("url_var_int","url_var_string","user_profile")');
             if (count($live)) {
                 foreach ($live as $l) {
                     if ($l->live == 'user_profile') {
                         $live_type = 'joomla_user';
                         $live_options = '{"content":"","property":"' . $l->live_value . '"}';
                     } elseif ($l->live == 'url_var_int') {
                         $live_type = 'url_variable';
                         $live_options = '{"variable":"' . $l->live_value . '","type":"int"}';
                     } elseif ($l->live == 'url_var_string') {
                         $live_type = 'url_variable';
                         $live_options = '{"variable":"' . $l->live_value . '","type":"string"}';
                     }
                     if (!JCckDatabase::doQuery('UPDATE #__cck_core_type_field SET live = "' . $live_type . '", live_options = "' . $db->escape($live_options) . '" WHERE typeid = ' . $l->typeid . ' AND fieldid = ' . $l->fieldid . ' AND client = "' . $l->client . '"')) {
                         $bool = false;
                     }
                 }
             }
             $live = JCckDatabase::loadObjectList('SELECT searchid, fieldid, client, live, live_value FROM #__cck_core_search_field WHERE live IN ("url_var_int","url_var_string","user_profile")');
             if (count($live)) {
                 foreach ($live as $l) {
                     if ($l->live == 'user_profile') {
                         $live_type = 'joomla_user';
                         $live_options = '{"content":"","property":"' . $l->live_value . '"}';
                     } elseif ($l->live == 'url_var_int') {
                         $live_type = 'url_variable';
                         $live_options = '{"variable":"' . $l->live_value . '","type":"int"}';
                     } elseif ($l->live == 'url_var_string') {
                         $live_type = 'url_variable';
                         $live_options = '{"variable":"' . $l->live_value . '","type":"string"}';
                     }
                     if (!JCckDatabase::doQuery('UPDATE #__cck_core_search_field SET live = "' . $live_type . '", live_options = "' . $db->escape($live_options) . '" WHERE searchid = ' . $l->searchid . ' AND fieldid = ' . $l->fieldid . ' AND client = "' . $l->client . '"')) {
                         $bool = false;
                     }
                 }
             }
             if ($bool) {
                 JCckDatabase::doQuery('UPDATE #__extensions SET enabled = 0 WHERE element IN ("url_var_int","url_var_string","user_profile") AND folder = "cck_field_live"');
             }
         }
         if ($i2 < 25) {
             $table = JTable::getInstance('asset');
             $table->loadByName('com_cck');
             if ($table->rules) {
                 $rules = (array) json_decode($table->rules);
                 $rules['core.delete.own'] = array(6 => "1");
                 $table->rules = json_encode($rules);
                 $table->store();
             }
         }
         if ($i2 < 31) {
             $src = JPATH_ADMINISTRATOR . '/components/com_cck/install/src/tmp/joomla_message';
             if (JFolder::exists($src)) {
                 JFolder::copy($src, JPATH_SITE . '/plugins/cck_storage_location/joomla_message', '', true);
             }
         }
         if ($i2 < 33) {
             $folders = array(10, 11, 12, 13, 14);
             foreach ($folders as $folder) {
                 Helper_Folder::rebuildBranch($folder);
             }
         }
         if ($i2 < 35) {
             $objects = array('joomla_article' => 'article', 'joomla_category' => 'category', 'joomla_user' => 'user', 'joomla_user_group' => 'user_group');
             foreach ($objects as $k => $v) {
                 $params = JCckDatabase::loadResult('SELECT options FROM #__cck_core_objects WHERE name = "' . $k . '"');
                 $params = json_decode($params);
                 $params->default_type = JCck::getConfig_Param('integration_' . $v, '');
                 $params->add_redirect = $params->default_type != '' ? '1' : '0';
                 $params->edit = JCck::getConfig_Param('integration_' . $v . '_edit', '0');
                 if ($k == 'joomla_category') {
                     $params->exclude = JCck::getConfig_Param('integration_' . $v . '_exclude', '');
                 }
                 JCckDatabase::doQuery('UPDATE #__cck_core_objects SET options = "' . $db->escape(json_encode($params)) . '" WHERE name = "' . $k . '"');
             }
         }
         if ($i2 < 45) {
             $table = '#__cck_store_item_users';
             $columns = $db->getTableColumns($table);
             if (isset($columns['password2'])) {
                 JCckDatabase::doQuery('ALTER TABLE ' . JCckDatabase::quoteName($table) . ' DROP ' . JCckDatabase::quoteName('password2'));
             }
         }
         if ($i2 < 66) {
             $path = JPATH_ADMINISTRATOR . '/components/com_cck/download.php';
             if (JFile::exists($path)) {
                 JFile::delete($path);
             }
         }
         if ($i2 < 70) {
             $plg_image = JPluginHelper::getPlugin('cck_field', 'upload_image');
             $plg_params = new JRegistry($plg_image->params);
             $com_cck = JComponentHelper::getComponent('com_cck');
             $com_cck->params->set('media_quality_jpeg', $plg_params->get('quality_jpeg', '90'));
             $com_cck->params->set('media_quality_png', $plg_params->get('quality_png', '3'));
             JCckDatabase::doQuery('UPDATE #__extensions SET params = "' . $db->escape($com_cck->params->toString()) . '" WHERE type = "component" AND element = "com_cck"');
         }
         // Folder Tree
         Helper_Folder::rebuildTree(2, 1);
     }
     // Overrides
     $path = JPATH_ADMINISTRATOR . '/components/com_cck/install/src';
     if (JFolder::exists($path)) {
         $folders = JFolder::folders($path, '^joomla');
         $folders = array_reverse($folders);
         $count = count($folders);
         foreach ($folders as $folder) {
             $version = str_replace('joomla', '', $folder);
             if (version_compare(JVERSION, $version, 'lt')) {
                 $path .= '/' . $folder;
                 $len = strlen($path);
                 $items = JFolder::files($path, '.', true, true, array('index.html'));
                 if (count($items)) {
                     foreach ($items as $item) {
                         $dest = JPATH_SITE . substr($item, $len);
                         JFile::copy($item, $dest);
                     }
                 }
                 break;
             }
         }
     }
     // Tmp
     $path = JPATH_ADMINISTRATOR . '/components/com_cck/install/src/tmp';
     if (JFolder::exists($path)) {
         JFolder::delete($path);
     }
 }
コード例 #18
0
 protected static function _getTable($pk = 0, $join = false)
 {
     $table = JTable::getInstance('category');
     if ($pk > 0) {
         $table->load($pk);
         if ($table->id) {
             if ($join) {
                 // todo:join
                 $join = JCckDatabase::loadObject('SELECT a.title, a.alias FROM #__categories AS a WHERE a.id = ' . $table->parent_id);
                 //@
                 if (is_object($join) && isset($join->title)) {
                     $table->parent_title = $join->title;
                     $table->parent_alias = $join->alias;
                 } else {
                     $table->parent_title = '';
                     $table->parent_alias = '';
                 }
             }
             if (JCck::on('3.1')) {
                 $table->tags = new JHelperTags();
                 $table->tags->getTagIds($table->id, 'com_content.category');
                 // todo: dynamic context per extension
             }
         }
     }
     return $table;
 }
コード例 #19
0
ファイル: default_app.php プロジェクト: densem-2013/exikom
}
?>

<script type="text/javascript">
jQuery(document).ready(function($) {	
	$(".app-download").live("click", function() {
		var id = $(this).attr("title");
		var url = "<?php 
echo $link2;
?>
"+id;
		var elements = $("#app_elements").myVal();
		var opts = "&options[aa]=1&options[bb]=2";
		var opts = "";
		$(".app-options").each(function(j) {
			var k = $(this).attr("id");
			var v = $(this).myVal();
			opts += "&options["+k+"]="+v;
		});
		document.location.href	=	url+"&elements="+elements+"&dep_categories="+$("#app_dependencies_categories").myVal()+"&dep_menu="+$("#app_dependencies_menu").myVal()+opts;
		return;
	});
	<?php 
if (!JCck::on()) {
    ?>
		$("ul.adminformlist li > label").css("width","175px");
	<?php 
}
?>
});
</script>
コード例 #20
0
 public static function addToolbarHistoryButton($extension = 'com_cck')
 {
     if (!JCck::on()) {
         return;
     }
     $pk = JCckDatabase::loadResult('SELECT extension_id FROM #__extensions WHERE type = "component" AND element = "' . $extension . '"');
     if ($pk > 0) {
         require_once JPATH_ADMINISTRATOR . '/components/com_cck/helpers/toolbar/link.php';
         JToolBar::getInstance('toolbar')->appendButton('CckLink', 'notification', 'COM_CCK_POSTINSTALL_HISTORY', JRoute::_(JUri::base() . 'index.php?option=com_postinstall&eid=' . $pk), '_self');
     }
 }
コード例 #21
0
ファイル: edit.php プロジェクト: hamby/SEBLOD
<?php

/**
* @version 			SEBLOD 3.x Core
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2009 - 2016 SEBLOD. All Rights Reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined('_JEXEC') or die;
JCckDev::forceStorage();
$class = JCck::on() ? '' : ' class="hide"';
$options2 = JCckDev::fromJSON($this->item->options2);
$task_id = array('export' => '', 'process' => '');
if (isset($options2['task'])) {
    if ($options2['task'] == 'export' || $options2['task'] == 'process') {
        $task_id[$options2['task']] = $options2['task_id'];
    }
}
?>

<div class="seblod">
    <?php 
echo JCckDev::renderLegend(JText::_('COM_CCK_CONSTRUCTION'), JText::_('PLG_CCK_FIELD_' . $this->item->type . '_DESC'));
?>
    <ul class="adminformlist adminformlist-2cols">
        <?php 
echo JCckDev::renderForm('core_label', $this->item->label, $config);
echo '<li' . $class . '><label>' . JText::_('COM_CCK_LABEL_ICON') . '</label>' . JCckDev::getForm('core_dev_select', $this->item->bool6, $config, array('label' => 'Label Icon', 'defaultvalue' => '0', 'selectlabel' => '', 'options' => 'Hide=0||Show=optgroup||Prepend=1||Append=2||Replace=3', 'storage_field' => 'bool6')) . JCckDev::getForm('core_icons', @$options2['icon'], $config, array('css' => 'max-width-150')) . '</li>';
echo JCckDev::renderBlank('<input type="hidden" id="blank_li3" value="" />');
コード例 #22
0
ファイル: integration.php プロジェクト: codigoaberto/SEBLOD
 public static function rewriteBuffer($buffer, $data, $list, $list_assoc = array())
 {
     $app = JFactory::getApplication();
     $class = JCck::on('3.4') ? ' class="hasTooltip"' : '';
     $idx = 0;
     $idx2 = 2;
     $idx3 = 3;
     $items = array();
     $list2 = array();
     $multilanguage = 0;
     if (JCckDevHelper::hasLanguageAssociations()) {
         $multilanguage = isset($data['multilanguage']) && $data['multilanguage'] ? 1 : 0;
     }
     $pks = '';
     $return = $data['return_view'] ? '&return_o=' . $data['return_option'] . '&return_v=' . $data['return_view'] : '&return_o=' . $data['return_option'];
     preg_match_all($data['search'], $buffer, $matches);
     if (strpos($data['search'], '>') !== false) {
         $isComplete = true;
         $markup_end = '';
     } else {
         $isComplete = false;
         $markup_end = '>';
     }
     $opt_default_type = $data['options']->get('default_type', '');
     $opt_edit_alt = $data['options']->get('edit_alt', 1);
     if (count($matches[$idx2])) {
         if ($data['options']->get('edit', 0) == 1) {
             $i = 0;
             foreach ($matches[$idx2] as $k => $m) {
                 $type = @$list[$m]->cck;
                 $type = $type ? '&type=' . $type : '&type=' . $opt_default_type;
                 $search = $matches[$idx][$k];
                 $list2[$m] = array('link' => 'index.php?option=com_cck&amp;view=form' . $return . $type . '&id=' . $m . $data['replace_end']);
                 $replace = '<a' . $class . ' href="' . $list2[$m]['link'];
                 if ($isComplete) {
                     $replace .= ' ' . $matches[$idx3][$k] . '>';
                 }
                 $buffer = str_replace($search, $replace, $buffer);
                 $items[$i] = $matches[$idx][$k];
                 $i++;
             }
         } else {
             $i = 0;
             foreach ($matches[$idx2] as $k => $m) {
                 if (isset($list[$m]->cck)) {
                     $type = $list[$m]->cck;
                     $type = $type ? '&type=' . $type : '&type=' . $opt_default_type;
                     $search = $matches[$idx][$k];
                     $list2[$m] = array('link' => 'index.php?option=com_cck&amp;view=form' . $return . $type . '&id=' . $m . $data['replace_end']);
                     $replace = '<a' . $class . ' href="' . $list2[$m]['link'];
                     if ($isComplete) {
                         $replace .= ' ' . $matches[$idx3][$k] . '>';
                     }
                     $buffer = str_replace($search, $replace, $buffer);
                     $items[$i] = $matches[$idx][$k];
                     $i++;
                 }
             }
         }
     }
     if (JCck::on()) {
         if ($data['search_alt']) {
             $search = $data['search_alt'];
             preg_match_all($search, $buffer, $matches2);
             if (count($matches2[0])) {
                 if ($multilanguage) {
                     $languages = JLanguageHelper::getLanguages('lang_code');
                 }
                 foreach ($matches2[0] as $k => $m) {
                     $pk = $matches[$idx2][$k];
                     $pre = '';
                     $row = $matches2[0][$k];
                     $search = '';
                     $t_add = '';
                     $t_edit = '';
                     if (isset($matches[$idx][$k])) {
                         if ($opt_edit_alt) {
                             if (isset($list2[$pk])) {
                                 $text = '<span class="icon-pencil"></span> ' . JText::_('JTOOLBAR_EDIT') . ' (' . JText::_('LIB_CCK_LEGACY') . ')';
                                 $pre = $matches[$idx][$k] . $markup_end . $text . '</a></li>';
                             } else {
                                 $link = 'index.php?option=com_cck&amp;view=form' . $return . '&type=' . $opt_default_type . '&id=' . $pk . $data['replace_end'];
                                 $text = '<span class="icon-pencil"></span> ' . JText::_('JTOOLBAR_EDIT') . ' (' . JText::_('LIB_CCK_SEBLOD') . ')';
                                 $pre = '<a href="' . $link . '">' . $text . '</a></li>';
                             }
                         }
                         if ($multilanguage) {
                             if (isset($list[$pk]) && $list[$pk]->key) {
                                 $cur = $list[$pk]->language;
                                 $key = $list[$pk]->key;
                                 $link = 'index.php?option=com_cck&amp;view=form' . $return . '&type=' . $list[$pk]->cck;
                                 foreach ($languages as $l => $v) {
                                     if ($cur != $l) {
                                         if (isset($list_assoc[$key][$l])) {
                                             $link2 = $link . '&amp;id=' . $list_assoc[$key][$l]->id . $data['replace_end'];
                                             $t_edit .= '<li><a href="' . $link2 . '&plop=1"><span class="icon-arrow-right-3"> ' . $l . '</a></li>';
                                         } else {
                                             $link2 = $link . '&amp;translate=' . $l . '&amp;translate_id=' . $pk . $data['replace_end'];
                                             $t_add .= '<li><a href="' . $link2 . '"><span class="icon-arrow-right-3"> ' . $l . '</a></li>';
                                         }
                                     }
                                 }
                                 if ($t_edit || $t_add) {
                                     $pre .= '<li class="divider"></li>';
                                     if ($t_edit) {
                                         $pre .= '<li><a href="javascript:void(0);"><span class="icon-comments-2"></span> ' . JText::_('LIB_CCK_TRANSLATE_EDIT') . '</a></li>' . $t_edit;
                                     }
                                     if ($t_add) {
                                         $pre .= '<li><a href="javascript:void(0);"><span class="icon-comments-2"></span> ' . JText::_('LIB_CCK_TRANSLATE') . '</a></li>' . $t_add;
                                     }
                                 }
                             }
                         }
                         if ($pre != '') {
                             $pre .= '<li class="divider"></li>';
                             $buffer = str_replace($row, $pre . '<li>' . $row, $buffer);
                         }
                     }
                 }
             }
         }
     } elseif ($data['options']->get('edit_alt', 1)) {
         $search = '#<a href="index.php\\?option=com_cck&amp;view=form(.*):(.*)([a-z\\-0-9]*)\\)(.*)</p>#sU';
         preg_match_all($search, $buffer, $matches2);
         if (count($matches2[3])) {
             foreach ($matches2[3] as $k => $m) {
                 if (isset($matches[$idx][$k])) {
                     $search = ': ' . $matches2[3][$k] . ')';
                     $replace = ': ' . $items[$k] . ' style="color: #888888;">' . $m . '</a>)';
                     $matches0 = str_replace($search, $replace, $matches2[0][$k]);
                     $buffer = str_replace($matches2[0][$k], $matches0, $buffer);
                 }
             }
         }
     }
     return $buffer;
 }
コード例 #23
0
ファイル: view.raw.php プロジェクト: codigoaberto/SEBLOD
 function prepareDisplay_Ajax()
 {
     $featured = $this->state->get('skeleton_id', 0);
     // Fields
     $objects = '';
     $pos = isset($this->style->positions[0]->value) ? $this->style->positions[0]->value : 'mainbody';
     $this->fields = Helper_Workshop::getFields('type', $this->item, 'a.folder = ' . (int) $featured, false, false, $pos);
     $this->fieldsAv = Helper_Workshop::getFieldsAv('type', $this->item, $objects, 'a.folder != ' . (int) $featured);
     $this->type_fields = JCckDatabase::loadObjectList('SELECT fieldid, GROUP_CONCAT(DISTINCT typeid separator " c-") AS cc FROM #__cck_core_type_field group by fieldid', 'fieldid');
     // Positions
     $positions = Helper_Workshop::getPositions('type', $this->item);
     if (count($this->style->positions)) {
         $this->positions = array();
         foreach ($this->style->positions as $p) {
             if ($p->value) {
                 $this->positions[$p->value] = new stdClass();
                 $this->positions[$p->value]->title = $p->text;
                 $this->positions[$p->value]->name = $p->value;
                 $this->positions[$p->value]->disable = false;
                 $this->positions[$p->value]->legend = @$positions[$p->value]->legend;
                 $this->positions[$p->value]->variation = @$positions[$p->value]->variation;
                 $this->positions[$p->value]->variation_options = @$positions[$p->value]->variation_options;
                 $this->positions[$p->value]->width = @$positions[$p->value]->width;
                 $this->positions[$p->value]->height = @$positions[$p->value]->height;
             }
         }
     }
     $this->positions_nb = count($this->positions);
     $this->variations = Helper_Workshop::getPositionVariations($this->style->template);
     // Filters
     $max_width = JCck::on() ? '' : ' style="max-width:180px;"';
     $default_f = $this->item->id > 0 ? $this->item->folder : '';
     $options = Helper_Admin::getPluginOptions('field', 'cck_', true, false, true);
     $this->lists['af_t'] = JHtml::_('select.genericlist', $options, 'filter_type', 'class="inputbox filter input-medium" prefix="t-"' . $max_width, 'value', 'text', '', 'filter1');
     $options = Helper_Admin::getAlphaOptions(true);
     $this->lists['af_a'] = JHtml::_('select.genericlist', $options, 'filter_alpha', 'class="inputbox filter input-medium" prefix="a-"', 'value', 'text', '', 'filter3');
     $options = Helper_Admin::getTypeOptions(true, false);
     $this->lists['af_c'] = JHtml::_('select.genericlist', $options, 'filter_type', 'class="inputbox filter input-medium" prefix="c-"' . $max_width, 'value', 'text', '', 'filter4');
     $options = Helper_Admin::getFolderOptions(true, true, false, true, 'field');
     $this->lists['af_f'] = JHtml::_('select.genericlist', $options, 'filter_folder', 'class="inputbox filter input-medium" prefix="f-"' . $max_width, 'value', 'text', $default_f, 'filter2');
 }
コード例 #24
0
ファイル: cckjs.php プロジェクト: codigoaberto/SEBLOD
 protected function _addScripts($id, $events, $format)
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     $js = '';
     $js2 = '';
     $js3 = '';
     $option = $app->input->get('option');
     $tweak = false;
     $tweaks = array();
     if (JCck::on() && ($option == 'com_menus' || $option == 'com_modules')) {
         $tweak = true;
     }
     // appendTo
     if ($events['appendTo']) {
         $move = explode('=', $events['appendTo']);
         $element = $move[0];
         $fragments = explode(',', $move[1]);
         $id = $this->id;
         $js = '';
         $js2 = '';
         if (count($fragments)) {
             foreach ($fragments as $fragment) {
                 $fragment = trim($fragment);
                 if (strpos($fragment, 'J(') !== false) {
                     if ($tweak) {
                         //
                     } else {
                         $fragment = substr($fragment, 2, -1);
                         if (strpos($fragment, '|') !== false) {
                             $frag = explode('|', $fragment);
                             $frag[1] = ' ' . $frag[1];
                         } else {
                             $frag = array(0 => $fragment, 1 => '');
                         }
                         $frag[0] = JText::_('COM_CCK_' . str_replace(' ', '_', $frag[0]));
                         $f = '<div class=\'textdesc' . $frag[1] . '\'>' . $frag[0] . '</div>';
                         $js .= '.append("' . $f . '")';
                     }
                 } else {
                     if ($tweak) {
                         $tweaks[] = $fragment;
                     } else {
                         $js .= '.append($("' . $fragment . '"))';
                         $js2 .= 'if ($("' . $fragment . '-lbl")) { $("' . $fragment . '-lbl").parent().remove(); }';
                     }
                 }
             }
         }
         if ($js != '' && !$tweak) {
             $js = ' $("#' . $element . '").parent().append("<div id=\\"' . $id . '-more\\"></div>"); $("div#' . $id . '-more")' . $js . '; ' . $js2;
         }
     }
     // isVisibleWhen
     if ($events['isVisibleWhen']) {
         $e = explode('=', $events['isVisibleWhen']);
         if (isset($e[1])) {
             if (count($tweaks)) {
                 foreach ($tweaks as $tw) {
                     $js2 .= '$("' . $tw . '").isVisibleWhen(' . $e[1] . ');';
                 }
             } else {
                 $js2 = '$("' . $e[0] . '").isVisibleWhen(' . $e[1] . ');';
             }
         } else {
             if (count($tweaks)) {
                 foreach ($tweaks as $tw) {
                     $js2 = '$("' . $tw . '").isVisibleWhen(' . $e[0] . ');';
                 }
             } else {
                 $js2 = '$("#' . $id . '").isVisibleWhen(' . $e[0] . ');';
             }
         }
     }
     // isDisabledWhen
     if ($events['isDisabledWhen']) {
         $e = explode('=', $events['isDisabledWhen']);
         if (isset($e[1])) {
             $js3 = '$("' . $e[0] . '").isDisabledWhen(' . $e[1] . ');';
         } else {
             $js3 = '$("#' . $id . '").isDisabledWhen(' . $e[0] . ');';
         }
     }
     // Set
     if ($js || $js2 || $js3) {
         $js = 'jQuery(document).ready(function($){' . $js . ' ' . $js2 . ' ' . $js3 . '});';
         if ($format == 'raw') {
             return '<script type="text/javascript">' . $js . '</script>';
         } else {
             $doc->addScriptDeclaration($js);
         }
     }
     return;
 }
コード例 #25
0
ファイル: computation.php プロジェクト: hamby/SEBLOD
							var disp = ($("#toggle_attr").prop("checked") !== false) ? \'style="display: block"\' : "";
							$("#sortable_core_options>div:last input:text[name=\'fields[]\']").val("' . $this->item->name . '").parent().append(\'<div class="attr"\'+disp+\'><input type="text" id="targets__0" name="targets[]" value="" class="inputbox mini" style="position:relative; top:3px;" size="10" /><span class="star"> &sup1;</span></div>\');
						}
					});
				});
			})(jQuery);
			';
$doc->addScriptDeclaration($js);
$field = JCckDatabase::loadObject('SELECT id, title, name FROM #__cck_core_fields WHERE name = "' . $this->item->name . '"');
if ((int) $this->item->id > 0) {
    $fields = JCckDatabase::loadObjectList('SELECT DISTINCT a.title as text, a.name as value FROM #__cck_core_fields AS a' . ' LEFT JOIN #__cck_core_' . $this->item->type . '_field AS b ON b.fieldid = a.id' . ' WHERE b.' . $this->item->type . 'id = ' . $this->item->id . ' AND a.name != "' . $this->item->name . '" ORDER BY text');
    $fields = is_array($fields) && count($fields) ? array_merge(array(JHtml::_('select.option', '', '- ' . JText::_('COM_CCK_ADD_A_FIELD') . ' -')), $fields) : array();
} else {
    $fields = array();
}
$em = JCck::on() ? '31' : '33';
$css = 'div.collection-group-form{margin-right:0px;} ul.adminformlist-2cols li {width:' . $em . 'em!important; padding:0px 37px 0px 0px!important;} #custom{font-size:11px;}';
if (!$this->item->title) {
    $css .= '#collection-group-wrap-core_options__0{display:none;}';
}
$doc->addStyleDeclaration($css);
$selectors = explode(',', $this->item->title);
?>

<?php 
echo '<div class="seblod"><div class="legend top center">' . $field->title . '</div></div>' . '<div class="seblod conditional">' . '<ul class="adminformlist adminformlist-2cols">' . '<li class="w100"><label>' . JText::_('COM_CCK_COMPUTATION') . '</label>' . JCckDev::getForm('core_dev_select', '', $config, array('defaultvalue' => 'sum', 'selectlabel' => 'Select', 'required' => 'required', 'storage_field' => 'math', 'options' => 'Custom=custom||Numeric=optgroup||Average=avg||Count=count||Format=format||Max=max||Min=min||Product=product||Sum=sum||String=optgroup||Concatenate=concatenate')) . JCckDev::getForm('core_computation_presets', '', $config, array('selectlabel' => 'Free')) . JCckDev::getForm('core_dev_text', '', $config, array('size' => 64, 'storage_field' => 'custom')) . '</li>' . '<li><label>' . JText::_('COM_CCK_FIELDS') . '</label>' . JCckDev::getForm('core_options', $selectors, $config, array('label' => 'Fields', 'rows' => 1, 'storage_field' => 'fields')) . JHtml::_('select.genericlist', $fields, 'fields_list', 'class="inputbox select" style="max-width:175px;"', 'value', 'text', '', 'fields_list') . '<input type="checkbox" id="toggle_attr" name="toggle_attr" value="1" /><label for="toggle_attr" class="toggle_attr">' . JText::_('COM_CCK_CUSTOM_ATTRIBUTE_AND_EVENT') . '</label>' . '</li>' . '<li><label>' . JText::_('COM_CCK_FORMAT_PRECISION') . '</label>' . JCckDev::getForm('core_computation_format', '', $config) . JCckDev::getForm('core_computation_precision', '', $config) . '</li>' . JCckDev::renderForm('core_computation_recalc', '', $config) . JCckDev::renderForm('core_computation_event', '', $config, array('defaultvalue' => 'change', 'options' => 'None=none||Event=optgroup||Event Change=change||Event Keyup=keyup', 'storage_field' => 'event'), array(), 'col2') . '</ul></div>';
?>
<div class="seblod inverted" style="display:none;">
	<span class="star">&sup1; </span><span class="star2"><?php 
echo JText::_('COM_CCK_COMPUTATION_CUSTOM_ATTR');
?>
コード例 #26
0
 public function ajaxSaveIntegration()
 {
     $app = JFactory::getApplication();
     $json = JCck::on() ? $app->input->JSON->getRaw() : $app->input->getRaw('integration');
     $objects = json_decode($json);
     if (count($objects)) {
         $query = 'UPDATE #__cck_core_objects SET options = CASE name';
         foreach ($objects as $k => $v) {
             $query .= ' WHEN "' . $k . '" THEN "' . JCckDatabase::escape(json_encode($v)) . '"';
             $in .= '"' . $k . '",';
         }
         $in = substr($in, 0, -1);
         $query .= ' ELSE options END WHERE name IN (' . $in . ')';
         JCckDatabase::execute($query);
     }
 }
コード例 #27
0
ファイル: checkbox.php プロジェクト: pctechnikch/SEBLOD
 public function onCCK_FieldPrepareForm(&$field, $value = '', &$config = array(), $inherit = array(), $return = false)
 {
     if (self::$type != $field->type) {
         return;
     }
     self::$path = parent::g_getPath(self::$type . '/');
     parent::g_onCCK_FieldPrepareForm($field, $config);
     // Init
     if (count($inherit)) {
         $id = isset($inherit['id']) && $inherit['id'] != '' ? $inherit['id'] : $field->name;
         $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name;
         $name = strpos($name, '[]') !== false ? substr($name, 0, -1) . $inherit['xk'] . ']' : $name;
     } else {
         $id = $field->name;
         $name = $field->name;
     }
     $value = $value != '' ? $value : $field->defaultvalue;
     $divider = $field->divider != '' ? $field->divider : ',';
     if (!is_array($value)) {
         $value = explode($divider, $value);
     }
     // Validate
     $validate = '';
     if ($config['doValidation'] > 1) {
         plgCCK_Field_ValidationRequired::onCCK_Field_ValidationPrepareForm($field, $id, $config);
         parent::g_onCCK_FieldPrepareForm_Validation($field, $id, $config);
         $validate = count($field->validate) ? ' validate[' . implode(',', $field->validate) . ']' : '';
     }
     // Prepare
     $attr = array('option.attr' => 'data-cck');
     $options = explode('||', $field->options);
     if ($field->location) {
         $attribs = explode('||', $field->location);
         $attrib = count($attribs);
         $options2 = json_decode($field->options2);
     } else {
         $attribs = array();
         $attrib = 0;
     }
     if ($field->bool8) {
         $field->bool8 = $config['doTranslation'];
     }
     if ($field->sorting == 1) {
         natsort($options);
         $optionsSorted = array_slice($options, 0);
     } elseif ($field->sorting == 2) {
         natsort($options);
         $optionsSorted = array_reverse($options, true);
     } else {
         $optionsSorted = $options;
     }
     $opts = array();
     if (count($optionsSorted)) {
         foreach ($optionsSorted as $i => $val) {
             if (trim($val) != '') {
                 $text = $val;
                 if (JString::strpos($val, '=') !== false) {
                     $opt = explode('=', $val);
                     $text = $opt[0];
                     $val = $opt[1];
                 }
                 if ($field->bool8 && trim($text) != '') {
                     $text = JText::_('COM_CCK_' . str_replace(' ', '_', trim($text)));
                 }
                 if ($attrib) {
                     $attr['attr'] = '';
                     foreach ($attribs as $k => $a) {
                         $attr['attr'] .= ' ' . $a . '="' . $options2->options[$i]->attr[$k] . '"';
                     }
                     $opts[] = JHtml::_('select.option', $val, $text, $attr);
                 } else {
                     $opts[] = JHtml::_('select.option', $val, $text, 'value', 'text');
                 }
             }
         }
     }
     $count = count($opts);
     if ($field->bool) {
         $orientation = ' vertical';
         $field->bool2 = !$field->bool2 ? 1 : $field->bool2;
         $modulo = $count % $field->bool2;
         $columns = (int) ($count / (!$field->bool2 ? 1 : $field->bool2));
     } else {
         $orientation = '';
     }
     $class = 'checkboxes' . $orientation . ($field->css ? ' ' . $field->css : '');
     $attr = 'class="' . $class . '"' . ($field->attributes ? ' ' . $field->attributes : '');
     $form = '<fieldset id="' . $id . '" ' . $attr . '>';
     if (JCck::on()) {
         $attr = 'class="checkbox' . $validate . '" size="1"';
     } else {
         $attr = 'class="inputbox checkbox' . $validate . '" size="1"';
     }
     $attr_key = 'data-cck';
     if ($field->bool && $field->bool2 > 1 && $count > 1) {
         $k = 0;
         foreach ($opts as $i => $o) {
             if ($i == 0) {
                 $form .= '<div class="cck-fl">';
             } elseif ($modulo && $k % ($columns + 1) == 0 || $modulo <= 0 && $k % $columns == 0) {
                 $form .= '</div><div class="cck-fl">';
                 $modulo--;
                 $k = 0;
             }
             $k++;
             $attr2 = isset($o->{$attr_key}) ? $o->{$attr_key} : '';
             $checked = in_array((string) $o->value, (array) $value) ? ' checked="checked" ' : '';
             $form .= '<input type="checkbox" id="' . $id . $i . '" name="' . $name . '[]" value="' . $o->value . '" ' . $checked . $attr . $attr2 . ' />';
             $form .= '<label for="' . $id . $i . '">' . $o->text . '</label>';
         }
         $form .= '</div>';
     } else {
         if ($count == 1 && strpos($optionsSorted[0], '=') === false) {
             foreach ($opts as $i => $o) {
                 $attr2 = isset($o->{$attr_key}) ? $o->{$attr_key} : '';
                 $checked = in_array((string) $o->value, (array) $value) ? ' checked="checked" ' : '';
                 $form .= '<input type="checkbox" id="' . $id . $i . '" name="' . $name . '[]" value="' . $o->value . '" ' . $checked . $attr . $attr2 . ' />';
             }
         } else {
             foreach ($opts as $i => $o) {
                 $attr2 = isset($o->{$attr_key}) ? $o->{$attr_key} : '';
                 $checked = in_array((string) $o->value, (array) $value) ? ' checked="checked" ' : '';
                 $form .= '<input type="checkbox" id="' . $id . $i . '" name="' . $name . '[]" value="' . $o->value . '" ' . $checked . $attr . $attr2 . ' />';
                 $form .= '<label for="' . $id . $i . '">' . $o->text . '</label>';
             }
         }
     }
     $form .= '</fieldset>';
     // Set
     if (!$field->variation) {
         $field->form = $form;
         if ($field->script) {
             parent::g_addScriptDeclaration($field->script);
         }
     } else {
         $doTranslation = $config['doTranslation'];
         if ($config['doTranslation']) {
             $config['doTranslation'] = $field->bool8;
         }
         $field->text = parent::g_getOptionText($value, $field->options, $divider, $config);
         $config['doTranslation'] = $doTranslation;
         parent::g_getDisplayVariation($field, $field->variation, $value, $field->text, $form, $id, $name, '<input', '', '', $config);
     }
     $field->value = $value;
     // Return
     if ($return === true) {
         return $field;
     }
 }
コード例 #28
0
$ordering = @$preconfig['ordering'] != '' ? $preconfig['ordering'] : $options->get('ordering', '');
$active = array();
$active[0] = 'cck';
$areas['active'] = $active;
if ($preconfig['task'] == 'search' || $preconfig['task'] == 'search2') {
    $post = $method ? JRequest::get('post') : JRequest::get('get');
}
$config = array('action' => $preconfig['action'], 'client' => $preconfig['client'], 'core' => true, 'doQuery' => true, 'doSEF' => $options->get('sef', JCck::getConfig_Param('sef', '2')), 'doTranslation' => JCck::getConfig_Param('language_jtext', 0), 'doValidation' => JCck::getConfig_Param('validation', '2'), 'formId' => $preconfig['formId'], 'Itemid' => $itemId, 'location' => '', 'pk' => $id, 'submit' => $preconfig['submit'], 'type' => $search->name, 'type_id' => $search->id, 'type_alias' => $search->alias ? $search->alias : $search->name, 'validate' => array(), 'validation' => array(), 'validation_options' => array());
jimport('cck.rendering.document.document');
JPluginHelper::importPlugin('cck_field');
JPluginHelper::importPlugin('cck_field_live');
JPluginHelper::importPlugin('cck_field_restriction');
$dispatcher = JDispatcher::getInstance();
// -------- -------- -------- -------- -------- -------- -------- -------- // Show Form
if ($preconfig['show_form']) {
    if (JCck::on('3.4')) {
        JHtml::_('behavior.core');
    }
    // Template
    $P = 'template_' . $preconfig['client'];
    $templateStyle = CCK_List::getTemplateStyle($search->{$P}, array('rendering_css_core' => $search->stylesheets));
    if (!$templateStyle) {
        $app->enqueueMessage('Oops! Template not found.. ; (', 'error');
        return;
    }
    $doc = CCK_Document::getInstance('html');
    // Positions
    $positions = array();
    $positions_more = CCK_List::getPositions($search->id, $preconfig['client']);
    // Template Override
    $tpl['home'] = $app->getTemplate();
コード例 #29
0
ファイル: default_filter.php プロジェクト: hamby/SEBLOD
?>
" id="filter-bar">
	<div class="<?php 
echo $this->css['filter_search'];
?>
">
        <?php 
echo JCckDev::getForm($cck['core_location_filter'], $this->state->get('filter.location'), $config);
echo JCckDev::getForm($cck['core_filter_input'], $this->escape($this->state->get('filter.search')), $config, array('attributes' => 'placeholder="' . JText::_('COM_CCK_ITEMS_SEARCH_FILTER') . '" style="text-align:center;"'), array('after' => "\n"));
echo JCckDev::getForm($cck['core_filter_go'], '', $config, array('css' => $this->css['filter_search_button']), array('after' => "\n"));
echo JCckDev::getForm($cck['core_filter_search'], '', $config, array('css' => $this->css['filter_search_button'], 'attributes' => 'onclick="' . $clear . 'this.form.submit();"'), array('after' => "\n"));
echo JCckDev::getForm($cck['core_filter_clear'], '', $config, array('css' => $this->css['filter_search_button'], 'attributes' => 'onclick="document.getElementById(\'filter_search\').value=\'\';document.getElementById(\'filter_location\').value=\'title\';' . $clear . 'this.form.submit();"'));
?>
	</div>
	<?php 
if (JCck::on()) {
    ?>
		<div class="<?php 
    echo $this->css['filter_search_list'];
    ?>
">
			<label for="limit" class="element-invisible"><?php 
    echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');
    ?>
</label>
			<select name="sortTable" id="sortTable" class="inputbox select input-medium" onchange="Joomla.orderTable()">
				<option value=""><?php 
    echo JText::_('JGLOBAL_SORT_BY');
    ?>
</option>
				<?php 
コード例 #30
0
ファイル: index.php プロジェクト: densem-2013/exikom
    ?>
    </div>
    <?php 
}
?>
	<?php 
// footer-line
if ($cck->getStyleParam('position_footer')) {
    if ($n = $cck->countFields('footer', true)) {
        echo $cck->renderPositions('footer', $cck->getStyleParam('position_footer_variation', ''), $n);
    }
}
?>
    <?php 
// hidden
if ($cck->countFields('modal') && JCck::on()) {
    JHtml::_('bootstrap.modal', 'collapseModal');
    ?>
        <div class="modal hide fade" id="collapseModal">
            <?php 
    echo $cck->renderPosition('modal');
    ?>
        </div>
    <?php 
}
?>
	<?php 
// hidden
if ($cck->countFields('hidden')) {
    ?>
        <div style="display: none;">