• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JCckDevHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JCckDevHelper的典型用法代码示例。如果您正苦于以下问题:PHP JCckDevHelper类的具体用法?PHP JCckDevHelper怎么用?PHP JCckDevHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JCckDevHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: addScript

 public static function addScript($url, $type = "text/javascript", $defer = false, $async = false)
 {
     $app = JFactory::getApplication();
     if (!isset($app->cck_document)) {
         $app->cck_document = array();
     }
     // Make sure to have only one inclusion of special external scripts
     if (strpos($url, 'http') !== false) {
         if (strpos($url, '//maps.googleapis.com/maps/api/js?') !== false) {
             if (isset(self::$_urls['google_maps'])) {
                 $cur = self::$_urls['google_maps'];
                 $vars2 = JCckDevHelper::getUrlVars($url);
                 if (!$vars2->def('libraries')) {
                     return;
                 }
                 $vars = JCckDevHelper::getUrlVars($cur);
                 $libraries = array();
                 $libraries[$vars->get('libraries')] = '';
                 $libraries[$vars2->get('libraries')] = '';
                 $libraries = array_keys($libraries);
                 $url = str_replace('libraries=' . $vars2->get('libraries'), 'libraries=' . implode(',', $libraries), $url);
                 unset($app->cck_document['scripts'][$cur]);
             }
             self::$_urls['google_maps'] = $url;
         }
     }
     $app->cck_document['scripts'][$url]['mime'] = $type;
     $app->cck_document['scripts'][$url]['defer'] = $defer;
     $app->cck_document['scripts'][$url]['async'] = $async;
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:30,代码来源:dev.php


示例2: onCCK_Storage_LocationAfterRender

 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);
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:32,代码来源:integration.php


示例3: createThumb

 public function createThumb($image, $tnumber, $twidth, $theight, $tformat, $quality = 100)
 {
     if (!($twidth && trim($twidth) != '' && is_numeric($twidth)) && !($theight && trim($theight) != '' && is_numeric($theight))) {
         return false;
     }
     $path = $this->_pathinfo['dirname'];
     $resImage = $this->_resource;
     // Calcul Thumb Size
     $values = $this->_prepareDimensions($this->_width, $this->_height, $twidth, $theight, $tformat);
     list($thumbX, $thumbY, $newX, $newY, $thumbWidth, $thumbHeight, $newWidth, $newHeight) = $values;
     // Add transparence for PNG
     $thumbImage = imageCreateTrueColor($thumbWidth, $thumbHeight);
     if ($this->_extension == 'png') {
         imagealphablending($thumbImage, false);
     }
     // Generate thumb ressource
     imagecopyresampled($thumbImage, $resImage, $thumbX, $thumbY, $newX, $newY, $thumbWidth, $thumbHeight, $newWidth, $newHeight);
     // Set Folder
     // $file_path ='';
     if ($tnumber == 0) {
         $thumbLocation = $path . '/' . $this->_pathinfo['basename'];
     } else {
         JCckDevHelper::createFolder($path . '/_thumb' . $tnumber);
         $thumbLocation = $path . '/_thumb' . $tnumber . '/' . $this->_pathinfo['basename'];
     }
     // Create image
     $this->_generateThumb($this->_extension, $thumbImage, $thumbLocation, $quality);
     return true;
 }
开发者ID:kolydart,项目名称:SEBLOD,代码行数:29,代码来源:image.php


示例4: onCCK_FieldConstruct

 public function onCCK_FieldConstruct($type, &$data = array())
 {
     if (self::$type != $type) {
         return;
     }
     if ($data['json']['options2']['path'][strlen($data['json']['options2']['path']) - 1] != '/') {
         $data['json']['options2']['path'] .= '/';
     }
     $data['json']['options2']['path'] = trim($data['json']['options2']['path']);
     JCckDevHelper::createFolder(JPATH_SITE . '/' . $data['json']['options2']['path']);
     parent::g_onCCK_FieldConstruct($data);
 }
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:12,代码来源:upload_image.php


示例5: onCCK_FieldPrepareForm

 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;
     } else {
         $id = $field->name;
         $name = $field->name;
     }
     $value = $value != '' ? $value : $field->defaultvalue;
     $value = $value != ' ' ? $value : '';
     // Validate
     $validate = '';
     if ($config['doValidation'] > 1) {
         plgCCK_Field_ValidationRequired::onCCK_Field_ValidationPrepareForm($field, $id, $config);
         $validate = count($field->validate) ? ' validate[' . implode(',', $field->validate) . ']' : '';
     }
     // Prepare
     $assoc = JCckDevHelper::hasLanguageAssociations();
     $form = '';
     if ($assoc && $config['pk']) {
         if (isset($config['base']->location) && $config['base']->location) {
             $location = $config['base']->location;
         } else {
             $location = JCckdatabase::loadResult('SELECT storage_location FROM #__cck_core_types WHERE name = "' . $config['type'] . '"');
         }
         if (is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $location . '/classes/helper.php')) {
             require_once JPATH_SITE . '/plugins/cck_storage_location/' . $location . '/classes/helper.php';
             $form = JCck::callFunc_Array('plgCCK_Storage_Location' . $location . '_Helper', 'getAssociationsForm', array($id, $name, $config));
         }
     }
     // Set
     if (!$field->variation) {
         $field->form = $form;
         if ($field->script) {
             parent::g_addScriptDeclaration($field->script);
         }
     } else {
         //
     }
     $field->value = $value;
     // Return
     if ($return === true) {
         return $field;
     }
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:52,代码来源:jform_associations.php


示例6: export_variation

 public function export_variation()
 {
     $app = JFactory::getApplication();
     $model = $this->getModel();
     $name = $app->input->getString('variation', '');
     $folder = $app->input->getString('folder', '');
     if ($file = $model->prepareExport_Variation($name, $folder)) {
         $file = JCckDevHelper::getRelativePath($file, false);
         $this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
     } else {
         $this->setRedirect('index.php?option=com_cck&view=variations');
     }
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:13,代码来源:template.php


示例7: CckParseRoute

function CckParseRoute($segments)
{
    $app = JFactory::getApplication();
    $count = count($segments);
    $menu = $app->getMenu();
    $menuItem = $menu->getActive();
    $vars = array();
    if ($segments[0] == 'form') {
        $menu->setActive($app->input->getInt('Itemid', 0));
        $vars['option'] = 'com_cck';
        $vars['view'] = 'form';
        $vars['layout'] = 'edit';
        $vars['type'] = $segments[1];
    } else {
        $legacy = 0;
        // check later
        if (!($menuItem->query['option'] == 'com_cck' && $menuItem->query['view'] == 'list')) {
            $legacy = 0;
        }
        if (!$legacy) {
            if (isset($menuItem->query['search'])) {
                $params = JCckDevHelper::getRouteParams($menuItem->query['search']);
            }
            if (isset($params['location']) && $params['location'] && is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php')) {
                require_once JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php';
                JCck::callFunc_Array('plgCCK_Storage_Location' . $params['location'], 'parseRoute', array(&$vars, $segments, $count, $params));
            } else {
                $legacy = 1;
            }
        }
        if ($legacy) {
            if ($count == 2) {
                $vars['option'] = 'com_content';
                $vars['view'] = 'article';
                $vars['catid'] = $segments[0];
                $vars['id'] = $segments[1];
            } elseif ($count == 1) {
                $vars['option'] = 'com_content';
                @(list($id, $alias) = explode(':', $segments[0], 2));
                $category = JCategories::getInstance('Content')->get($id);
                if ($category && $category->id == $id && $category->alias == $alias) {
                    $vars['view'] = 'categories';
                } else {
                    $vars['view'] = 'article';
                }
                $vars['id'] = $segments[0];
            }
        }
    }
    return $vars;
}
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:51,代码来源:router.php


示例8: prepareTable2

 protected function prepareTable2(&$table, &$data)
 {
     if (is_array($data['elements'])) {
         $data['elements'] = implode(',', $data['elements']);
     } else {
         $data['elements'] = '';
     }
     if (!$data['jform']['id'] && !$data['jform']['rules']) {
         $data['jform']['rules'] = array('core.create' => array(), 'core.delete' => array(), 'core.delete.own' => array(), 'core.edit' => array(), 'core.edit.state' => array(), 'core.edit.own' => array());
     }
     if ($data['jform']['rules']) {
         if (!is_array($data['jform']['rules'])) {
             $data['jform']['rules'] = json_decode($data['jform']['rules']);
         }
         $rules = new JAccessRules(JCckDevHelper::getRules($data['jform']['rules']));
         $table->setRules($rules);
     }
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:18,代码来源:folder.php


示例9: onCCK_FieldPrepareForm

 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;
     } else {
         $id = $field->name;
         $name = $field->name;
     }
     $value = $field->defaultvalue;
     // Prepare
     $value = JCckDevHelper::replaceLive($value);
     if ($field->bool8) {
         $field->bool8 = $config['doTranslation'];
     }
     if ($field->bool8) {
         $value = trim(preg_replace('/[^A-Za-z0-9_ ]/', '', strip_tags($value)));
         if ($value) {
             $value = JText::_('COM_CCK_' . str_replace(' ', '_', $value));
         }
     }
     $form = htmlspecialchars_decode($value);
     // Set
     if (!$field->variation) {
         $field->form = $form;
         if ($field->script) {
             parent::g_addScriptDeclaration($field->script);
         }
     } else {
         parent::g_getDisplayVariation($field, $field->variation, $value, $value, $form, $id, $name, '', '', '', $config);
     }
     $field->value = $value;
     // Return
     if ($return === true) {
         return $field;
     }
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:43,代码来源:freetext.php


示例10: export

 public function export()
 {
     $app = JFactory::getApplication();
     $model = $this->getModel();
     $recordId = $app->input->getInt('id', 0);
     $elements = $app->input->getString('elements', '');
     $elements = array_flip(explode(',', $elements));
     $dependencies = array();
     $menu = $app->input->getInt('dep_menu', 0);
     $options = $app->input->get('options', array(), 'array');
     if ($app->input->getInt('dep_categories', 0)) {
         $dependencies['categories'] = 1;
     }
     if ($menu) {
         $dependencies['menu'] = $menu;
     }
     if ($file = $model->prepareExport($recordId, $elements, $dependencies, $options)) {
         $file = JCckDevHelper::getRelativePath($file, false);
         $this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
     } else {
         $this->setRedirect(_C0_LINK, JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
     }
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:23,代码来源:folder.php


示例11: prepareTable2

 protected function prepareTable2(&$table, &$data)
 {
     if (!$data['jform']['id'] && !$data['jform']['rules']) {
         $data['jform']['rules'] = array('core.create' => array(), 'core.create.max.parent' => array('8' => "0"), 'core.create.max.parent.author' => array('8' => "0"), 'core.create.max.author' => array('8' => "0"), 'core.delete' => array(), 'core.delete.own' => array(), 'core.edit' => array(), 'core.edit.own' => array());
     }
     if ($data['jform']['rules']) {
         if (!is_array($data['jform']['rules'])) {
             $data['jform']['rules'] = json_decode($data['jform']['rules']);
         }
         jimport('cck.joomla.access.access');
         $rules = new CCKRules(JCckDevHelper::getRules($data['jform']['rules']), 'com_cck', 'form');
         $table->setRules($rules);
     }
 }
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:14,代码来源:type.php


示例12: getRouteByStorage

 public static function getRouteByStorage(&$storage, $sef, $itemId, $config = array(), $lang_tag = '')
 {
     if (isset($storage[self::$table]->_route) && !$lang_tag) {
         return JRoute::_($storage[self::$table]->_route);
     }
     if ($sef) {
         if ($sef == '0' || $sef == '1') {
             $path = '&catid=' . $storage[self::$table]->catid;
         } elseif ($sef[0] == '4') {
             $path = '&catid=' . (isset($storage[self::$table]->category_alias) ? $storage[self::$table]->category_alias : $storage[self::$table]->catid);
         } elseif ($sef[0] == '3') {
             $path = '&typeid=' . $config['type'];
         } else {
             $path = '';
         }
         if (is_object($storage[self::$table])) {
             $storage[self::$table]->_route = self::_getRoute($sef, $itemId, $storage[self::$table]->slug, $path);
         }
         // Multilanguage Associations
         if (JCckDevHelper::hasLanguageAssociations()) {
             $app = JFactory::getApplication();
             $pk = $storage[self::$table]->id;
             if ($app->input->get('view') == 'article' && $app->input->get('id') == $storage[self::$table]->id && !count(self::$routes)) {
                 JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
                 $assoc_c = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $pk);
                 $assoc_m = MenusHelper::getAssociations($itemId);
                 $languages = JLanguageHelper::getLanguages();
                 $lang_code = JFactory::getLanguage()->getTag();
                 foreach ($languages as $l) {
                     if ($lang_code == $l->lang_code) {
                         self::$routes[$l->lang_code] = $storage[self::$table]->_route;
                     } else {
                         $itemId2 = isset($assoc_m[$l->lang_code]) ? $assoc_m[$l->lang_code] : 0;
                         $pk2 = isset($assoc_c[$l->lang_code]) ? (int) $assoc_c[$l->lang_code]->id : 0;
                         self::$routes[$l->lang_code] = '';
                         if ($pk2 && $itemId2) {
                             self::$routes[$l->lang_code] = self::getRoute($pk2, $sef, $itemId2, $config, $l->sef);
                         }
                     }
                 }
             }
         }
     } else {
         require_once JPATH_SITE . '/components/com_content/helpers/route.php';
         $storage[self::$table]->_route = ContentHelperRoute::getArticleRoute($storage[self::$table]->slug, $storage[self::$table]->catid, $storage[self::$table]->language);
     }
     return JRoute::_($storage[self::$table]->_route);
 }
开发者ID:kenyonjohnston,项目名称:hott_theater,代码行数:48,代码来源:joomla_article.php


示例13: _core

 protected function _core($data, &$config = array(), $pk = 0)
 {
     if (!$config['id']) {
         $isNew = true;
         $config['id'] = parent::g_onCCK_Storage_LocationPrepareStore();
     } else {
         $isNew = false;
     }
     // Init
     $table = self::_getTable($pk);
     $isNew = $pk > 0 ? false : true;
     if (isset($table->tags)) {
         $tags = $table->tags;
         unset($table->tags);
     } else {
         $tags = null;
     }
     if (isset($data['tags'])) {
         if (!empty($data['tags']) && $data['tags'][0] != '') {
             $table->newTags = $data['tags'];
         }
         unset($data['tags']);
     }
     self::_initTable($table, $data, $config);
     // Check Error
     if (self::$error === true) {
         return false;
     }
     // Prepare
     if (is_array($data)) {
         $table->bind($data);
     }
     if ($isNew && !isset($data['rules'])) {
         $data['rules'] = array('core.create' => array(), 'core.delete' => array(), 'core.edit' => array(), 'core.edit.state' => array(), 'core.edit.own' => array());
     }
     if (isset($data['rules']) && $data['rules']) {
         if (!is_array($data['rules'])) {
             $data['rules'] = json_decode($data['rules']);
         }
         $rules = new JAccessRules(JCckDevHelper::getRules($data['rules']));
         $table->setRules($rules);
     }
     $table->check();
     self::_completeTable($table, $data, $config);
     // Store
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('content');
     $dispatcher->trigger('onContentBeforeSave', array(self::$context, &$table, $isNew));
     if ($isNew === true && parent::g_isMax($table->{self::$author}, $table->{self::$parent}, $config)) {
         return;
     }
     if (!$table->store()) {
         JFactory::getApplication()->enqueueMessage($table->getError(), 'error');
         if ($isNew) {
             parent::g_onCCK_Storage_LocationRollback($config['id']);
         }
         return false;
     }
     // Checkin
     parent::g_checkIn($table);
     self::$pk = $table->{self::$key};
     if (!$config['pk']) {
         $config['pk'] = self::$pk;
     }
     $config['author'] = $table->{self::$author};
     $config['parent'] = $table->{self::$parent};
     parent::g_onCCK_Storage_LocationStore($data, self::$table, self::$pk, $config);
     $dispatcher->trigger('onContentAfterSave', array(self::$context, &$table, $isNew));
     // Associations
     // todo
 }
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:71,代码来源:joomla_category.php


示例14: process

 public function process()
 {
     // JSession::checkToken() or jexit( JText::_( 'JINVALID_TOKEN' ) );
     if (!is_file(JPATH_ADMINISTRATOR . '/components/com_cck_toolbox/models/cck_toolbox.php')) {
         $this->setRedirect($this->_getReturnPage(), JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
         return;
     }
     $app = JFactory::getApplication();
     $ids = $app->input->get('cid', array(), 'array');
     $task_id = $app->input->getInt('tid', 0);
     jimport('joomla.utilities.arrayhelper');
     JArrayHelper::toInteger($ids);
     require_once JPATH_ADMINISTRATOR . '/components/com_cck_toolbox/models/cck_toolbox.php';
     $model = JModelLegacy::getInstance('CCK_Toolbox', 'CCK_ToolboxModel');
     $params = JComponentHelper::getParams('com_cck_toolbox');
     $output = 1;
     // $params->get( 'output', 0 );
     if ($file = $model->prepareProcess($params, $task_id, $ids)) {
         if ($output > 0) {
             $this->setRedirect($this->_getReturnPage(), JText::_('COM_CCK_SUCCESSFULLY_PROCESSED'), 'message');
         } else {
             $file = JCckDevHelper::getRelativePath($file, false);
             $this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
         }
     } else {
         $this->setRedirect($this->_getReturnPage(), JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
     }
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:28,代码来源:list.php


示例15: getRouteByStorage

 public static function getRouteByStorage(&$storage, $sef, $itemId, $config = array())
 {
     if (isset($storage[self::$table]->_route)) {
         return JRoute::_($storage[self::$table]->_route);
     }
     if ($sef) {
         if ($sef == '0' || $sef == '1') {
             $path = '&catid=' . $storage[self::$table]->catid;
         } elseif ($sef[0] == '4') {
             $path = '&catid=' . (isset($storage[self::$table]->parent_alias) ? $storage[self::$table]->parent_alias : $storage[self::$table]->parent_id);
         } elseif ($sef[0] == '3') {
             $path = '&typeid=' . $config['type'];
         } else {
             $path = '';
         }
         if (is_object($storage[self::$table])) {
             $storage[self::$table]->_route = self::_getRoute($sef, $itemId, $storage[self::$table]->slug, $path);
         }
         // Multilanguage Associations
         if (JCckDevHelper::hasLanguageAssociations()) {
             // TODO (mod_cck_lang...)
         }
     } else {
         require_once JPATH_SITE . '/components/com_content/helpers/route.php';
         $storage[self::$table]->_route = ContentHelperRoute::getCategoryRoute($storage[self::$table]->id);
     }
     return JRoute::_($storage[self::$table]->_route);
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:28,代码来源:joomla_category.php


示例16: parse

 public function parse(&$segments)
 {
     $app = JFactory::getApplication();
     $count = count($segments);
     $menu = $app->getMenu();
     $menuItem = $menu->getActive();
     $vars = array();
     if ($segments[0] == 'form') {
         $menu->setActive($app->input->getInt('Itemid', 0));
         $vars['option'] = 'com_cck';
         $vars['view'] = 'form';
         $vars['layout'] = 'edit';
         $vars['type'] = @$segments[1];
     } else {
         $legacy = 0;
         // check later
         if (!($menuItem->query['option'] == 'com_cck' && $menuItem->query['view'] == 'list')) {
             $legacy = 0;
         }
         if (!$legacy) {
             if (isset($menuItem->query['search'])) {
                 $params = JCckDevHelper::getRouteParams($menuItem->query['search']);
                 if ($params['doSEF'][0] == '4' || $params['doSEF'][0] == '5') {
                     if ($count == 1) {
                         if (isset($params['location']) && $params['location'] && is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php')) {
                             require_once JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php';
                             $target = $params['doSEF'][0] == '5' ? 'author_object' : 'parent_object';
                             $properties = array($target);
                             $properties = JCck::callFunc('plgCCK_Storage_Location' . $params['location'], 'getStaticProperties', $properties);
                             if ($properties[$target] != '') {
                                 $params['doSEF'][0] = '2';
                                 $params['location'] = $properties[$target];
                             }
                         }
                     }
                 }
             }
             if (isset($params['location']) && $params['location'] && is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php')) {
                 require_once JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php';
                 JCck::callFunc_Array('plgCCK_Storage_Location' . $params['location'], 'parseRoute', array(&$vars, $segments, $count, $params));
             } else {
                 $legacy = 1;
             }
         }
         if ($legacy) {
             if ($count == 2) {
                 $vars['option'] = 'com_content';
                 $vars['view'] = 'article';
                 $vars['catid'] = $segments[0];
                 $vars['id'] = $segments[1];
             } elseif ($count == 1) {
                 $vars['option'] = 'com_content';
                 $idArray = explode(':', $segments[0], 2);
                 $id = (int) $idArray[0];
                 $alias = (string) @$idArray[1];
                 $category = JCategories::getInstance('Content')->get($id);
                 if ($category && $category->id == $id && $category->alias == $alias) {
                     $vars['view'] = 'categories';
                 } else {
                     $vars['view'] = 'article';
                 }
                 $vars['id'] = $segments[0];
             }
         }
     }
     return $vars;
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:67,代码来源:router.php


示例17: elseif

                }
            }
        }
    }
}
$show_more = $params->get('show_more', 1);
$show_link_more = $params->get('show_link_more', 0);
$show_more_class = $params->get('link_more_class', '');
$show_more_class = $show_more_class ? ' class="' . $show_more_class . '"' : '';
$show_more_text = $params->get('link_more_text', '');
if ($show_more_text == '') {
    $show_more_text = JText::_('MOD_CCK_LIST_VIEW_ALL');
} elseif (JCck::getConfig_Param('language_jtext', 0)) {
    $show_more_text = JText::_('COM_CCK_' . str_replace(' ', '_', trim($show_more_text)));
}
$show_more_link = '';
if (($show_more == 1 || $show_more == 2 && $total || $show_more == 3 && $total_items > $preconfig['limit2']) && $show_link_more) {
    $show_more_link = 'index.php?Itemid=' . $show_link_more;
    $show_more_link = JRoute::_($show_more_link);
    $show_more_vars = $params->get('link_more_variables', '');
    if ($show_more_vars) {
        $show_more_vars = JCckDevHelper::replaceLive($show_more_vars);
        if ($show_more_vars != '') {
            $show_more_link .= strpos($show_more_link, '?') !== false ? '&' . $show_more_vars : '?' . $show_more_vars;
        }
    }
}
$raw_rendering = $params->get('raw_rendering', 0);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
$class_sfx = $params->get('force_moduleclass_sfx', 0) == 1 ? $moduleclass_sfx : '';
require JModuleHelper::getLayoutPath('mod_cck_list', $params->get('layout', 'default'));
开发者ID:densem-2013,项目名称:exikom,代码行数:31,代码来源:mod_cck_list.php


示例18: defined

/**
* @version 			SEBLOD 3.x Core ~ $Id: mod_cck_form.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;
$show = $params->get('url_show', '');
$hide = $params->get('url_hide', '');
if ($show && JCckDevHelper::matchUrlVars($show) === false) {
    return;
}
if ($hide && JCckDevHelper::matchUrlVars($hide) !== false) {
    return;
}
$app = JFactory::getApplication();
$data = '';
$uniqId = 'm' . $module->id;
$formId = 'seblod_form_' . $uniqId;
if (!defined('JPATH_LIBRARIES_CCK')) {
    define('JPATH_LIBRARIES_CCK', JPATH_SITE . '/libraries/cck');
}
if (!defined('JROOT_MEDIA_CCK')) {
    define('JROOT_MEDIA_CCK', JURI::root(true) . '/media/cck');
}
JCck::loadjQuery();
JFactory::getLanguage()->load('com_cck_default', JPATH_SITE);
require_once JPATH_SITE . '/components/com_cck/helpers/helper_include.php';
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:30,代码来源:mod_cck_form.php


示例19: onCCK_FieldPrepareForm

 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 . '/');
     $field->label2 = trim(@$field->label2);
     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;
     } else {
         $id = $field->name;
         $name = $field->name;
     }
     $value = $field->label;
     $field->label = '';
     // Prepare
     $pre_task = '';
     $options2 = JCckDev::fromJSON($field->options2);
     $task = isset($options2['task']) && $options2['task'] ? $options2['task'] : 'save';
     $task_auto = isset($options2['task_auto']) && $options2['task_auto'] == '0' ? 0 : 1;
     $task_id = isset($options2['task_id']) && $options2['task_id'] ? $options2['task_id'] : 0;
     if (JFactory::getApplication()->isAdmin()) {
         $task = $config['client'] == 'admin' ? 'form.' . $task : 'list.' . $task;
     }
     if ($task_id) {
         $pre_task = htmlspecialchars('jQuery("#' . $config['formId'] . '").append(\'<input type="hidden" name="tid" value="' . $task_id . '">\');');
     }
     $class = 'button btn' . ($field->css ? ' ' . $field->css : '');
     if ($task == 'cancel') {
         $click = ' onclick="JCck.Core.submitForm(\'' . $task . '\', document.getElementById(\'seblod_form\'));"';
     } else {
         if ($task == 'export' || $task == 'process' || $task == 'list.export' || $task == 'list.process') {
             $click = $pre_task . $config['submit'] . '(\'' . $task . '\');return false;';
             if ($field->variation != 'toolbar_button') {
                 parent::g_addProcess('beforeRenderForm', self::$type, $config, array('name' => $field->name, 'task' => $task, 'task_auto' => $task_auto, 'task_id' => $task_id));
             }
             if (!$task_auto) {
                 $click = 'if (document.' . $config['formId'] . '.boxchecked.value==0){alert(\'' . JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST') . '\');}else{' . $click . '}';
             }
             $click = isset($config['submit']) ? ' onclick="' . $click . '"' : '';
         } elseif ($task == 'save2redirect') {
             $custom = '';
             if (isset($options2['custom']) && $options2['custom']) {
                 $custom = JCckDevHelper::replaceLive($options2['custom']);
                 $custom = $custom ? '&' . $custom : '';
             }
             if ($config['client'] == 'search') {
                 $pre_task = htmlspecialchars('jQuery("#' . $config['formId'] . '").attr(\'action\', \'' . JRoute::_('index.php?Itemid=' . $options2['itemid'] . $custom) . '\');');
             } else {
                 $pre_task = htmlspecialchars('jQuery("#' . $config['formId'] . ' input[name=\'config[url]\']").val(\'' . JRoute::_('index.php?Itemid=' . $options2['itemid'] . $custom) . '\');');
             }
             $click = isset($config['submit']) ? ' onclick="' . $pre_task . $config['submit'] . '(\'' . $task . '\');return false;"' : '';
         } else {
             $click = isset($config['submit']) ? ' onclick="' . $pre_task . $config['submit'] . '(\'' . $task . '\');return false;"' : '';
         }
     }
     if ($field->attributes && strpos($field->attributes, 'onclick="') !== false) {
         $matches = array();
         $search = '#onclick\\=\\"([a-zA-Z0-9_\\(\\)\\\'\\;\\.]*)"#';
         preg_match($search, $field->attributes, $matches);
         if (count($matches) && $matches[0]) {
             if ($matches[0] == $field->attributes) {
                 $field->attributes = substr(trim($field->attributes), 0, -1);
                 $click = ' ' . $field->attributes . '"';
                 $field->attributes = '';
             } else {
                 $click = ' onclick="' . $matches[1] . '"';
                 $field->attributes = trim(str_replace($matches[0], '', $field->attributes));
             }
         }
     }
     $attr = 'class="' . $class . '"' . $click . ($field->attributes ? ' ' . $field->attributes : '');
     if ($field->bool) {
         $label = $value;
         if (JCck::on()) {
             if ($field->bool6 == 3) {
                 $label = '<span class="icon-' . $options2['icon'] . '"></span>';
                 $attr .= ' title="' . $value . '"';
             } elseif ($field->bool6 == 2) {
                 $label = $value . "\n" . '<span class="icon-' . $options2['icon'] . '"></span>';
             } elseif ($field->bool6 == 1) {
                 $label = '<span class="icon-' . $options2['icon'] . '"></span>' . "\n" . $value;
             }
         }
         $type = $field->bool7 == 1 ? 'submit' : 'button';
         $form = '<button type="' . $type . '" id="' . $id . '" name="' . $name . '" ' . $attr . '>' . $label . '</button>';
         $tag = 'button';
     } else {
         $form = '<input type="submit" id="' . $id . '" name="' . $name . '" value="' . $value . '" ' . $attr . ' />';
         $tag = 'input';
     }
     if ($field->bool2 == 1) {
         $alt = $field->bool3 ? ' ' . JText::_('COM_CCK_OR') . ' ' : "\n";
         if ($config['client'] == 'search') {
             $onclick = 'onclick="jQuery(\'#' . $config['formId'] . '\').clearForm();"';
             $form .= $alt . '<a href="javascript: void(0);" ' . $onclick . ' title="' . JText::_('COM_CCK_RESET') . '">' . JText::_('COM_CCK_RESET') . '</a>';
         } else {
//.........这里部分代码省略.........
开发者ID:densem-2013,项目名称:exikom,代码行数:101,代码来源:button_submit.php


示例20: onCCK_StoragePrepareSearch

 public static function onCCK_StoragePrepareSearch(&$field, $match, $value, $name, $name2, $target, $fields = array(), &$config = array())
 {
     $sql = '';
     switch ($match) {
         case 'exact':
             $sql = $target . ' = ' . JCckDatabase::quote($value);
             break;
         case 'empty':
             $sql = $target . ' = ""';
             break;
         case 'alpha':
             $sql = $target . ' LIKE ' . JCckDatabase::quote(JCckDatabase::escape($value, true) . '%', false);
             break;
         case 'zeta':
             /* Zeta is not the last letter of Greek alphabet but.. this won't be an issue here. */
             $sql = $target . ' LIKE ' . JCckDatabase::quote('%' . JCckDatabase::escape($value, true), false);
             break;
         case 'any':
             $separator = $field->match_value ? $field->match_value : ' ';
             $values = explode($separator, $value);
             if (count($values)) {
                 $fragments = array();
                 foreach ($values as $v) {
                     if (strlen($v) > 0) {
                         $fragments[] = $target . ' LIKE ' . JCckDatabase::quote('%' . JCckDatabase::escape($v, true) . '%', false);
                     }
                 }
                 if (count($fragments)) {
                     $sql = '((' . implode(') OR (', $fragments) . '))';
                 }
             }
             break;
         case 'any_exact':
             $separator = $field->match_value ? $field->match_value : ' ';
             $values = explode($separator, $value);
             if (count($values)) {
                 $fragm 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JCckPluginField类代码示例发布时间:2022-05-23
下一篇:
PHP JCckDev类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap