當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JCckDatabase類代碼示例

本文整理匯總了PHP中JCckDatabase的典型用法代碼示例。如果您正苦於以下問題:PHP JCckDatabase類的具體用法?PHP JCckDatabase怎麽用?PHP JCckDatabase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了JCckDatabase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepareExport

 public function prepareExport($id = 0)
 {
     $config = JFactory::getConfig();
     $tmp_path = $config->get('tmp_path');
     $tmp_dir = uniqid('cck_');
     $path = $tmp_path . '/' . $tmp_dir;
     $extension = JCckDatabase::loadObject('SELECT name, type, element, folder FROM #__extensions WHERE extension_id=' . (int) $id);
     if (!$extension) {
         return;
     }
     jimport('cck.base.install.export');
     $name = $extension->element;
     $prefix = CCK_Export::getPrefix($extension->type);
     $src = JPATH_SITE . '/plugins/' . $extension->folder . '/' . $extension->element;
     $xml = JCckDev::fromXML($src . '/' . $name . '.xml');
     $version = isset($xml->version) ? '_' . $xml->version : '';
     $filename = $prefix . '_' . $extension->folder . '_' . $name . $version;
     $path_zip = $tmp_path . '/' . $filename . '.zip';
     if (!$filename) {
         return;
     }
     if ($src && JFolder::exists($src)) {
         JFolder::copy($src, $path);
         CCK_Export::clean($path);
     }
     CCK_Export::exportLanguage($src . '/' . $name . '.xml', JPATH_ADMINISTRATOR, $path);
     CCK_Export::findFields(array($src . '/tmpl/edit.php', $src . '/tmpl/edit2.php'), $path . '/install');
     return CCK_Export::zip($path, $path_zip);
 }
開發者ID:codigoaberto,項目名稱:SEBLOD,代碼行數:29,代碼來源:cck.php

示例2: getRow

 public static function getRow($id, $content_type = '')
 {
     if (!$id) {
         return NULL;
     }
     $index = $id . '_' . $content_type;
     if (isset(self::$_items[$index])) {
         return self::$_items[$index];
     }
     $row = JTable::getInstance('content');
     $row->load($id);
     if (!$content_type) {
         $content_type = JCckDatabase::loadResult('SELECT cck FROM #__cck_core WHERE storage_location = "joomla_article" AND pk = ' . $row->id);
     }
     if ($content_type) {
         $fields = JCckDatabase::loadObject('SELECT * FROM #__cck_store_form_' . $content_type . ' WHERE id = ' . $row->id);
         if (count($fields)) {
             foreach ($fields as $k => $v) {
                 $row->{$k} = $v;
             }
         }
     }
     self::$_items[$index] = $row;
     return $row;
 }
開發者ID:olafzieger,項目名稱:joomla3.x-seblod-test,代碼行數:25,代碼來源:article.php

示例3: processById

 public static function processById($id = 0)
 {
     $processing = JCckDatabase::loadObject('SELECT type, scriptfile FROM #__cck_more_processings WHERE published = 1 AND id = ' . (int) $id);
     if (is_object($processing) && is_file(JPATH_SITE . $processing->scriptfile)) {
         include_once JPATH_SITE . $processing->scriptfile;
     }
 }
開發者ID:kenyonjohnston,項目名稱:hott_theater,代碼行數:7,代碼來源:toolbox.php

示例4: getInput

 protected function getInput()
 {
     JPluginHelper::importPlugin('cck_field');
     require_once JPATH_PLUGINS . '/cck_field_validation/required/required.php';
     $name = 'core_options';
     $override = array('rows' => 1);
     $storage = (string) $this->element['cck_storage_field_prefix'];
     $and = $storage != '' ? ' AND a.storage_field LIKE "' . $storage . '%"' : '';
     $fields = JCckDatabase::loadObjectList('SELECT a.title as text, a.name as value FROM #__cck_core_fields AS a' . ' WHERE a.storage = "dev" AND a.id > 500' . $and . ' ORDER BY text');
     $fields = is_array($fields) ? array_merge(array(JHtml::_('select.option', '', '- ' . JText::_('COM_CCK_ADD_A_FIELD') . ' -')), $fields) : array();
     $html = JHtml::_('select.genericlist', $fields, 'fields_list', 'size="1" class="inputbox select" style="max-width:175px;"', 'value', 'text', '', 'fields_list');
     $format = (string) $this->element['js_format'];
     $lang = JFactory::getLanguage();
     $lang->load('com_cck');
     $lang->load('com_cck_default', JPATH_SITE);
     if ($format != 'raw') {
         JCck::loadjQuery(true, true, true);
     }
     $force_id = (string) $this->element['id'];
     $config = array('asset' => '', 'asset_id' => 0, 'client' => '', 'doTranslation' => 1, 'doValidation' => 2, 'pk' => '');
     if ($format == 'raw') {
         $config['tmpl'] = 'ajax';
     }
     $inherit = $force_id != '' ? array('id' => (string) $this->element['id']) : array();
     $field = JCckDevField::getObject($name);
     if (!$field) {
         return;
     }
     $storage_field = $field->storage_field;
     $field->storage_field = $this->name;
     $field = JCckDevField::get($field, $this->value, $config, $inherit, $override);
     $script = $this->_addScripts((string) $this->element['name'], array('value' => $this->value), $format);
     return $field->form . $html . $script;
 }
開發者ID:codigoaberto,項目名稱:SEBLOD,代碼行數:34,代碼來源:cckpicker.php

示例5: addSubmenu

 public static function addSubmenu($option, $vName)
 {
     $addons = array();
     $items = array();
     $uix = JCck::getUIX();
     $vName2 = JFactory::getApplication()->input->get('filter_e_type', '');
     if (JCck::on()) {
         $folder = JText::_('COM_CCK_' . _C0_TEXT . 'S');
         if ($uix == 'compact') {
             $items = array(array('name' => $folder, 'link' => _C0_LINK, 'active' => $vName == _C0_NAME), array('val' => '2', 'pre' => '', 'key' => 'COM_CCK_'));
         } else {
             $items = array(array('name' => $folder, 'link' => _C0_LINK, 'active' => $vName == _C0_NAME), array('val' => '2', 'pre' => '- ', 'key' => 'COM_CCK_', 'active' => $vName == _C2_NAME || $vName == _C6_NAME && $vName2 == 'type'), array('val' => '3', 'pre' => '- ', 'key' => ''), array('val' => '4', 'pre' => '- ', 'key' => 'COM_CCK_', 'active' => $vName == _C4_NAME || $vName == _C6_NAME && $vName2 == 'search'), array('val' => '1', 'pre' => '- ', 'key' => '', 'active' => $vName == _C1_NAME || $vName == _C7_NAME), array('val' => '5', 'pre' => '', 'key' => ''));
         }
         if ($vName == 'cck') {
             $addons = JCckDatabase::loadObjectList('SELECT a.title, a.link, b.element FROM #__menu AS a LEFT JOIN #__extensions AS b ON b.extension_id = a.component_id' . ' WHERE a.link LIKE "index.php?option=com_cck\\_%" ORDER BY a.title ASC');
         }
     } else {
         $folder = '<img src="' . JROOT_MEDIA_CCK . '/images/12/icon-12-folders.png" border="0" alt=" " width="12" height="12" />';
         if ($uix == 'compact') {
             $items = array(array('val' => '2', 'pre' => '', 'key' => 'COM_CCK_'), array('name' => $folder, 'link' => _C0_LINK, 'active' => $vName == _C0_NAME));
         } else {
             $items = array(array('val' => '2', 'pre' => '', 'key' => 'COM_CCK_'), array('val' => '3', 'pre' => '', 'key' => ''), array('val' => '4', 'pre' => '', 'key' => 'COM_CCK_'), array('val' => '1', 'pre' => '', 'key' => ''), array('name' => $folder, 'link' => _C0_LINK, 'active' => $vName == _C0_NAME), array('val' => '5', 'pre' => '', 'key' => ''));
         }
     }
     self::addSubmenuEntries($option, $vName, $items, $addons);
 }
開發者ID:olafzieger,項目名稱:joomla3.x-seblod-test,代碼行數:26,代碼來源:helper_admin.php

示例6: 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 = '&amp;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

示例7: g_onCCK_PaymentValidate

 public static function g_onCCK_PaymentValidate($data, $success, &$config)
 {
     $update = 'pay_return = "' . JCckDatabase::escape(json_encode($data['order'])) . '",' . 'pay_return_payments = "' . JCckDatabase::escape(json_encode($data['payments'])) . '",' . 'state = ' . $data['order_state'];
     JCckDatabase::execute('UPDATE #__cck_more_ecommerce_orders SET ' . $update . ' WHERE pay_key = "' . $config['pay_key'] . '"');
     if (!$success) {
         return;
     }
     // Cart
     $cart_id = (int) JCckDatabase::loadResult('SELECT a.id FROM #__cck_more_ecommerce_carts AS a WHERE a.pay_key = "' . $config['pay_key'] . '"');
     if ($cart_id) {
         JCckDatabase::execute('UPDATE #__cck_more_ecommerce_carts SET pay_key = "" WHERE id = ' . $cart_id);
         JCckDatabase::execute('DELETE a.* FROM #__cck_more_ecommerce_cart_product AS a WHERE a.cart_id = ' . $cart_id);
     }
     // Execute Processings (Invoice, Notifications, ...)
     if (JCckToolbox::getConfig()->get('processing', 0)) {
         $event = 'onCckPaymentSuccess';
         $processing = JCckDatabaseCache::loadObjectListArray('SELECT type, scriptfile, options FROM #__cck_more_processings WHERE published = 1 ORDER BY ordering', 'type');
         if (isset($processing[$event])) {
             foreach ($processing[$event] as $p) {
                 if (is_file(JPATH_SITE . $p->scriptfile)) {
                     $options = new JRegistry($p->options);
                     include_once JPATH_SITE . $p->scriptfile;
                 }
             }
         }
     }
 }
開發者ID:codigoaberto,項目名稱:SEBLOD,代碼行數:27,代碼來源:payment.php

示例8: prepareSidebar

 protected function prepareSidebar()
 {
     if (!JCck::on()) {
         return;
     }
     $buttons = array();
     if (JCck::getUIX() == 'compact') {
         $core = array(array('val' => '2', 'pre' => '', 'key' => 'COM_CCK_'));
     } else {
         $core = array(array('val' => '0', 'pre' => '', 'key' => 'COM_CCK_', 'img' => 'cck-application'), array('val' => '2', 'pre' => '-&nbsp;', 'key' => 'COM_CCK_', 'img' => 'cck-form'), array('val' => '3', 'pre' => '-&nbsp;', 'key' => '', 'img' => 'cck-plugin'), array('val' => '4', 'pre' => '-&nbsp;', 'key' => 'COM_CCK_', 'img' => 'cck-search'), array('val' => '1', 'pre' => '-&nbsp;', 'key' => '', 'img' => 'cck-template'), array('val' => '5', 'pre' => '', 'key' => '', 'img' => 'cck-multisite'));
     }
     $components = JCckDatabase::loadObjectList('SELECT a.title, a.link, b.element' . ' FROM #__menu AS a LEFT JOIN #__extensions AS b ON b.extension_id = a.component_id' . ' WHERE a.link LIKE "index.php?option=com_cck\\_%"' . ' AND a.link NOT IN ("index.php?option=com_cck_toolbox&view=processing","index.php?option=com_cck_webservices&view=api")' . ' ORDER BY a.title ASC');
     $groupedButtons = array();
     $more = array('ADDON' => 16, 'PLUGIN_FIELD' => 19, 'PLUGIN_LINK' => 20, 'PLUGIN_LIVE' => 21, 'PLUGIN_RESTRICTION' => 112, 'PLUGIN_TYPOGRAPHY' => 24, 'PLUGIN_VALIDATION' => 25, 'TEMPLATE' => 27);
     foreach ($core as $k => $v) {
         $buttons[] = array('access' => array('core.manage', 'com_cck'), 'group' => 'COM_CCK_CORE', 'image' => $v['img'], 'link' => JRoute::_(constant('_C' . $v['val'] . '_LINK')), 'target' => '_self', 'text' => $v['pre'] . JText::_($v['key'] . constant('_C' . $v['val'] . '_TEXT') . 'S'));
     }
     foreach ($components as $k => $v) {
         $buttons[] = array('access' => array('core.manage', $v->element), 'group' => 'COM_CCK_SEBLOD_MORE', 'image' => 'cck-addon', 'link' => JRoute::_($v->link), 'target' => '_self', 'text' => $v->title);
     }
     foreach ($more as $k => $v) {
         $buttons[] = array('access' => array('core.manage', 'com_cck'), 'group' => 'COM_CCK_SEBLOD_COM', 'image' => 'download', 'link' => JRoute::_('http://www.seblod.com/products?seb_item_category=' . $v), 'target' => '_blank', 'text' => JText::_('COM_CCK_PANE_MORE_' . $k));
     }
     foreach ($buttons as $button) {
         $groupedButtons[$button['group']][] = $button;
     }
     $this->sidebar = '<div class="sidebar-nav quick-icons">' . JHtml::_('links.linksgroups', $groupedButtons) . '</div>';
 }
開發者ID:kolydart,項目名稱:SEBLOD,代碼行數:28,代碼來源:view.html.php

示例9: save

 public function save($key = null, $urlVar = null)
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $model = $this->getModel('form');
     $preconfig = $app->input->post->get('config', array(), 'array');
     $task = $this->getTask();
     $config = $model->store($preconfig);
     $id = $config['pk'];
     if ($config['validate'] == 'retry') {
         parent::display();
         return true;
     }
     if ($id) {
         if ($config['stage'] > -1) {
             $link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . '&id=' . $id . $this->_getRedirectQuery();
             if ($config['stage'] > 0) {
                 $link .= '&stage=' . $config['stage'];
             }
             $this->setRedirect(htmlspecialchars_decode($link));
             return;
         }
         if ($config['message_style']) {
             if (isset($config['message'])) {
                 $msg = $config['doTranslation'] ? JText::_('COM_CCK_' . str_replace(' ', '_', trim($config['message']))) : $config['message'];
             } else {
                 $msg = JText::_('COM_CCK_SUCCESSFULLY_SAVED');
             }
             $msgType = $config['message_style'];
         } else {
             $msg = '';
             $msgType = '';
         }
     } else {
         $msg = JText::_('JERROR_AN_ERROR_HAS_OCCURRED');
         $msgType = 'error';
     }
     switch ($task) {
         case 'apply':
             $link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . '&id=' . $id . $this->_getRedirectQuery();
             break;
         case 'save2new':
             $link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . $this->_getRedirectQuery();
             break;
         case 'save2view':
             $location = JCckDatabase::loadResult('SELECT storage_location FROM #__cck_core WHERE id = ' . (int) $id);
             $sef = 0;
             $itemId2 = 0;
             if ($location) {
                 require_once JPATH_SITE . '/plugins/cck_storage_location/' . $location . '/' . $location . '.php';
                 $link = JCck::callFunc_Array('plgCCK_Storage_Location' . $location, 'getRoute', array($config['pk'], $sef, $itemId2, array('type' => $config['type'])));
                 $link = str_replace('/administrator/', '/', $link);
                 break;
             }
         default:
             $link = $this->_getRedirectQuery(true);
             break;
     }
     $this->setRedirect(htmlspecialchars_decode($link), $msg, $msgType);
 }
開發者ID:densem-2013,項目名稱:exikom,代碼行數:60,代碼來源:form.php

示例10: _delete

 protected function _delete($pk, $location, $base)
 {
     $id = JCckDatabase::loadResult('SELECT id FROM #__cck_core WHERE storage_location = "' . (string) $location . '" AND pk = ' . (int) $pk);
     if (!$id) {
         return true;
     }
     $table = JCckTable::getInstance('#__cck_core', 'id', $id);
     $type = $table->cck;
     $pkb = (int) $table->pkb;
     $table->delete();
     if ($pkb > 0) {
         $table = JTable::getInstance('content');
         $table->delete($pkb);
     }
     $tables = JCckDatabase::loadColumn('SHOW TABLES');
     $prefix = JFactory::getConfig()->get('dbprefix');
     if (in_array($prefix . 'cck_store_item_' . $base, $tables)) {
         $table = JCckTable::getInstance('#__cck_store_item_' . $base, 'id', $pk);
         if ($table->id) {
             $table->delete();
         }
     }
     if (in_array($prefix . 'cck_store_form_' . $type, $tables)) {
         $table = JCckTable::getInstance('#__cck_store_form_' . $type, 'id', $pk);
         if ($table->id) {
             $table->delete();
         }
     }
 }
開發者ID:hamby,項目名稱:SEBLOD,代碼行數:29,代碼來源:cck.php

示例11: getGateway

 public static function getGateway()
 {
     $user = JFactory::getUser();
     $access = implode(',', $user->getAuthorisedViewLevels());
     $name = JCckDatabase::loadResult('SELECT type' . ' FROM #__cck_more_ecommerce_gateways' . ' WHERE published = 1 AND access IN (' . $access . ')' . ' ORDER BY id DESC');
     return $name;
 }
開發者ID:hamby,項目名稱:SEBLOD,代碼行數:7,代碼來源:payment.php

示例12: getCall

 public static function getCall($name)
 {
     static $cache = array();
     if (!isset($cache[$name])) {
         $cache[$name] = JCckDatabase::loadObject('SELECT b.name, b.type, b.options, a.request, a.request_object, a.request_options, a.response' . 'FROM #__cck_more_webservices_calls AS a' . ' LEFT JOIN #__cck_more_webservices AS b ON b.id = a.webservice' . ' WHERE a.name = "' . $name . '"');
     }
     return $cache[$name];
 }
開發者ID:olafzieger,項目名稱:joomla3.x-seblod-test,代碼行數:8,代碼來源:webservice.php

示例13: onCCK_FieldExportField

 public static function onCCK_FieldExportField(&$field, &$data, &$extensions)
 {
     $field->options = self::_exportCategories($field->options, '||', $data);
     $name = $field->storage_field2 != '' ? $field->storage_field2 : $field->storage_field;
     $sql_table = '#__cck_store_join_' . $name;
     $sql_path = $data['root_sql'] . '/' . $sql_table . '.sql';
     $sql_buffer = JCckDatabase::getTableCreate(array($sql_table));
     JFile::write($sql_path, $sql_buffer);
 }
開發者ID:codigoaberto,項目名稱:SEBLOD,代碼行數:9,代碼來源:app.php

示例14: getTargets

 public static function getTargets($id)
 {
     static $cache = array();
     if (!isset($cache[$id])) {
         $cache[$id] = JCckDatabase::loadColumn('SELECT product_id FROM #__cck_more_ecommerce_promotion_product WHERE promotion_id = ' . (int) $id);
         $cache[$id] = array_flip($cache[$id]);
     }
     return $cache[$id];
 }
開發者ID:densem-2013,項目名稱:exikom,代碼行數:9,代碼來源:promotion.php

示例15: countItems

 public static function countItems($store_id, $object = 'joomla_article')
 {
     $cache = array();
     $count = 0;
     $user = JFactory::getUser();
     if (!isset($cache[$store_id])) {
         $cache[$store_id] = JCckDatabase::loadResult('SELECT COUNT(a.id) FROM #__cck_core AS a' . ' LEFT JOIN #__content AS b ON (b.id = a.pk AND a.storage_location = "joomla_article")' . ' WHERE a.store_id = ' . $store_id . ' AND b.state = 1');
     }
     return $cache[$store_id];
 }
開發者ID:densem-2013,項目名稱:exikom,代碼行數:10,代碼來源:store.php


注:本文中的JCckDatabase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。