Example #1
0
 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);
 }
Example #2
0
 public static function onCCK_Storage_LocationAfterDispatch(&$data, $uri = array())
 {
     $return = '&return_o=' . substr($uri['option'], 4) . '&return_v=' . $uri['view'];
     if (!$uri['layout']) {
         if ($uri['view'] != 'users') {
             return;
         }
         $do = $data['options']->get('add', 1);
         $data['options']->set('add_alt_link', 'index.php?option=com_users&view=user&layout=edit&cck=1');
         if ($do == 1) {
             JCckDevIntegration::addModalBox($data['options']->get('add_layout', 'icon'), $return, $data['options']);
         } elseif ($do == 2) {
             JCckDevIntegration::addDropdown('form', $return, $data['options']);
         }
     } elseif ($uri['layout'] == 'edit' && !$uri['id']) {
         if ($uri['view'] != 'user') {
             return;
         }
         if ($data['options']->get('add_redirect', 1)) {
             JCckDevIntegration::redirect($data['options']->get('default_type'), $return . 's');
         }
     }
 }
Example #3
0
 public static function onCCK_Storage_LocationAfterDispatch(&$data, $uri = array())
 {
     $app = JFactory::getApplication();
     $ext = $app->input->get('extension', '');
     $exclude = $data['options']->get('exclude', '');
     $extensions = explode(',', str_replace(' ', '', $exclude));
     $return = '&extension=' . $ext . '&return_o=' . substr($uri['option'], 4);
     if (!in_array($ext, $extensions)) {
         if (!$uri['layout']) {
             $do = $data['options']->get('add', 1);
             $data['options']->set('add_alt_link', 'index.php?option=com_categories&view=category&layout=edit&extension=' . $ext . '&cck=1');
             if ($do == 1) {
                 JCckDevIntegration::addModalBox($data['options']->get('add_layout', 'icon'), $return, $data['options']);
             } elseif ($do == 2) {
                 JCckDevIntegration::addDropdown('form', $return, $data['options']);
             }
             JCckDevIntegration::addWarning('copy');
         } elseif ($uri['layout'] == 'edit' && !$uri['id']) {
             if ($data['options']->get('add_redirect', 1)) {
                 JCckDevIntegration::redirect($data['options']->get('default_type'), $return);
             }
         }
     }
 }
/**
* @version 			SEBLOD 3.x Core ~ $Id: default_status.php sebastienheraud $
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2013 SEBLOD. All Rights Reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined('_JEXEC') or die;
if (JCck::on()) {
    $class = '';
    $href = '#';
    if (!$app->input->getBool('hidemainmenu')) {
        $layout = JPATH_ADMINISTRATOR . '/components/com_cck/views/form/tmpl/modal_' . $modal_layout . '.php';
        JCckDevIntegration::appendModal($layout, 'collapseModal3', '.cck-quickadd > button', array('quickadd' => 1));
        $class = ' btn-success';
    }
    ?>
	<div class="btn-group cck-quickadd">
		<button href="<?php 
    echo $href;
    ?>
" class="btn btn-small<?php 
    echo $class;
    ?>
" data-toggle="modal" data-target="#collapseModal3">
			<i class="icon-plus"></i>
			<?php 
    echo $label;
    ?>
Example #5
0
**/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$base = 'index.php?option=com_cck&view=form';
$doc = JFactory::getDocument();
$lang = JFactory::getLanguage();
$type = '';
$user = JFactory::getUser();
if (isset($params['quickadd']) && $params['quickadd'] == 1) {
    $legacy = 0;
    $url = 'none';
} else {
    $legacy = $options->get('add_alt');
    $url = '';
}
$folders = JCckDevIntegration::getForms($url, $type, 'folder');
$target_id = isset($target_id) ? $target_id : 'collapseModal2';
if ($legacy == 1) {
    $legend = '';
    $legend = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND1', '<a id="joomla-standard-content" href="' . $options->get('add_alt_link') . '">' . JText::_('LIB_CCK_INTEGRATION_CLICK_HERE') . '</a>');
    $legend2 = '';
} elseif ($legacy == 2) {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND2', '<a id="joomla-standard-content" href="' . $options->get('add_alt_link') . '">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_CLICK_HERE')) . '</a>');
} else {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = '';
}
$doc->addStyleDeclaration('div.modal-footer button.pull-left{position:relative; top:8px;}');
?>
Example #6
0
**/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$base = 'index.php?option=com_cck&view=form';
$doc = JFactory::getDocument();
$lang = JFactory::getLanguage();
$type = '';
$user = JFactory::getUser();
if (isset($params['quickadd']) && $params['quickadd'] == 1) {
    $legacy = 0;
    $url = 'none';
} else {
    $legacy = $options->get('add_alt');
    $url = '';
}
$items = JCckDevIntegration::getForms($url, $type);
$doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_cck/assets/css/cpanel.css');
$target_id = isset($target_id) ? $target_id : 'collapseModal2';
if ($legacy == 1) {
    $legend = '';
    $legend = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND1', '<a id="joomla-standard-content" href="' . $options->get('add_alt_link') . '">' . JText::_('LIB_CCK_INTEGRATION_CLICK_HERE') . '</a>');
    $legend2 = '';
} elseif ($legacy == 2) {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND2', '<a id="joomla-standard-content" href="' . $options->get('add_alt_link') . '">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_CLICK_HERE')) . '</a>');
} else {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = '';
}
$doc->addStyleDeclaration('div.modal-footer button.pull-left{position:relative; top:8px;}');
?>
Example #7
0
 public function onAfterRender()
 {
     $app = JFactory::getApplication();
     $option = $app->input->get('option', '');
     $view = $app->input->get('view', '');
     $layout = $app->input->get('layout', '');
     // site
     if ($app->isSite()) {
         if ($this->multisite === true && $this->site_cfg->get('offline') && isset($this->offline_buffer)) {
             $uri = JFactory::getURI();
             $app->setUserState('users.login.form.data', array('return' => (string) $uri));
             JResponse::setHeader('Status', '503 Service Temporarily Unavailable', 'true');
             JResponse::setBody($this->offline_buffer);
         }
         return;
     }
     // admin
     if ($app->isAdmin() && JFactory::getDocument()->getType() == 'html') {
         $buffer = JResponse::getBody();
         $buffer = str_replace('icon-cck-', 'myicon-cck-', $buffer);
         switch ($option) {
             case 'com_cck':
             case 'com_cck_developer':
             case 'com_cck_ecommerce':
             case 'com_cck_exporter':
             case 'com_cck_importer':
             case 'com_cck_manager':
             case 'com_cck_multilingual':
             case 'com_cck_packager':
             case 'com_cck_toolbox':
             case 'com_cck_updater':
             case 'com_cck_webservices':
                 $buffer = $this->_setBasics($buffer, $option, $view);
                 break;
             case 'com_postinstall':
                 $eid = $app->input->get('eid', 0);
                 $eid2 = JCckDatabase::loadResult('SELECT extension_id FROM #__extensions WHERE type = "component" AND element = "com_cck"');
                 if ($eid && $eid == $eid2) {
                     $buffer = str_replace('com_cck', 'SEBLOD', $buffer);
                     $buffer = str_replace('option=SEBLOD', 'option=com_cck', $buffer);
                 }
                 break;
             case 'com_templates':
                 if ($view == 'templates' || $layout == 'edit') {
                     break;
                 }
                 $search = '#administrator/index.php\\?option=com_templates&amp;task=style.edit&amp;id=(.*)">(.*)</a>#sU';
                 $list = JCckDatabase::loadObjectList('SELECT a.id, b.name FROM #__template_styles AS a LEFT JOIN #__cck_core_templates AS b ON b.name = a.template WHERE b.name != ""', 'id');
                 preg_match_all($search, $buffer, $matches);
                 if (count($matches[1])) {
                     $i = 0;
                     $style = 'height:14px; color:#ffffff; background-color:#0088CC; margin:0px 12px 0px 12px; padding:2px 8px 2px 8px; font-size:10px; font-weight:bold;';
                     foreach ($matches[1] as $match) {
                         if (isset($list[$match])) {
                             $replace = $matches[0][$i] . '<span style="' . $style . '">SEBLOD</span>Do NOT set as Default Template !';
                             $buffer = str_replace($matches[0][$i], $replace, $buffer);
                         }
                         $i++;
                     }
                 }
                 break;
             default:
                 $and = $view ? ' AND ( a.view = "' . $view . '" OR a.view = "" )' : '';
                 $locations = JCckDatabase::loadObjectList('SELECT a.name, a.options FROM #__cck_core_objects AS a WHERE a.component = "' . $option . '"' . $and);
                 $uri = array('option' => $option, 'view' => $view, 'layout' => $layout);
                 if (count($locations)) {
                     foreach ($locations as $location) {
                         $path = JPATH_SITE . '/plugins/cck_storage_location/' . $location->name . '/classes/integration.php';
                         if (is_file($path)) {
                             $data = array('doIntegration' => false, 'multilanguage' => 0, 'options' => new JRegistry($location->options), 'replace_end' => '"', 'return_option' => substr($option, 4), 'return_view' => $view, 'return' => '', 'search' => '', 'search_alt' => '');
                             require_once $path;
                             JCck::callFunc_Array('plgCCK_Storage_Location' . $location->name . '_Integration', 'onCCK_Storage_LocationAfterRender', array(&$buffer, &$data, $uri));
                             if ($data['doIntegration']) {
                                 $list = JCckDatabase::loadObjectList('SELECT pk, cck FROM #__cck_core WHERE storage_location="' . $location->name . '"', 'pk');
                                 $buffer = JCckDevIntegration::rewriteBuffer($buffer, $data, $list);
                             }
                         }
                     }
                 }
                 break;
         }
         JResponse::setBody($buffer);
         return;
     }
 }
Example #8
0
$market = 'http://www.seblod.com/download.html?tmpl=component';
$opts = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=685,height=600';
$quickadd = $app->input->getInt('quickadd', 0);
$type = '';
$variables = base64_decode($app->input->getBase64('variables'));
$return = base64_decode($app->input->getBase64('return'));
$user = JFactory::getUser();
if ($quickadd) {
    $legacy = 0;
    $url = 'none';
    $items = $layer == 'list' ? JCckDevIntegration::getForms($url, $type, 'folder') : JCckDevIntegration::getForms($url, $type);
} else {
    $legacy = 2;
    $url = JCckDevHelper::getUrlVars($return);
    $layer = JCck::getConfig_Param('integration_layout', 'icon');
    $items = $layer == 'list' ? JCckDevIntegration::getForms($url, $type, 'folder') : JCckDevIntegration::getForms($url, $type);
    if (strpos($type, ',') === false) {
        $options = JCckDatabase::loadResult('SELECT a.options FROM #__cck_core_objects AS a WHERE a.name = "' . $type . '"');
        $options = new JRegistry($options);
        $legacy = $options->get('add_alt', 2);
    }
}
if ($legacy == 1) {
    $legend = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND', '<a id="standard-content" href="javascript:void(0);" style="color:#808080">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_CLICK_HERE')) . '</a>', '<span style="color:#808080">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM')) . '</span>');
    $legend2 = '';
} elseif ($legacy == 2) {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND2', '<a id="standard-content" href="javascript:void(0);" style="color:#808080">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_CLICK_HERE')) . '</a>');
} else {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = '';