本文整理匯總了PHP中JCck::getConfig_Param方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCck::getConfig_Param方法的具體用法?PHP JCck::getConfig_Param怎麽用?PHP JCck::getConfig_Param使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCck
的用法示例。
在下文中一共展示了JCck::getConfig_Param方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addValidation
public static function addValidation($rules, $options, $id = '', &$config = array())
{
$doc = JFactory::getDocument();
if (!$id) {
$id = 'seblod_form';
}
if (empty($rules)) {
$rules = '';
}
$rules = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $rules);
if (is_object($options)) {
$bgcolor = $options->get('validation_background_color', JCck::getConfig_Param('validation_background_color', ''));
$color = $options->get('validation_color', JCck::getConfig_Param('validation_color', ''));
$position = $options->get('validation_position', JCck::getConfig_Param('validation_position', 'topRight'));
$scroll = $options->get('validation_scroll', JCck::getConfig_Param('validation_scroll', 1)) ? 'scroll:true' : 'scroll:false';
if ($color != '') {
if ($position == 'inline') {
$doc->addStyleDeclaration('#' . $id . ' .formError .formErrorContent{color: ' . $color . '}');
} else {
$doc->addStyleDeclaration('.formError .formErrorContent{color: ' . $color . '}');
}
}
if ($position != 'inline' && $bgcolor != '') {
$doc->addStyleDeclaration('.formError .formErrorContent, .formError .formErrorArrow div{background: ' . $bgcolor . '}');
}
$options = '{' . $scroll . ',promptPosition:"' . $position . '"}';
} else {
$options = '{}';
}
$doc->addStyleSheet(JURI::root(true) . '/media/cck/css/cck.validation.css');
$doc->addScript(JURI::root(true) . '/media/cck/js/cck.validation-3.2.0.min.js');
$js = 'jQuery(document).ready(function($){ $.validationEngineLanguage.newLang({' . $rules . '}); $("#' . $id . '").validationEngine(' . $options . '); });';
$doc->addScriptDeclaration($js);
}
示例2: onCCK_Field_ValidationPrepareForm
public static function onCCK_Field_ValidationPrepareForm(&$field, $fieldId, &$config)
{
if (self::$type != $field->validation) {
return;
}
$and = '';
$extra = '';
$extraData2 = '';
$name = 'availability_' . $fieldId;
$validation = parent::g_getValidation($field->validation_options);
$alert = self::_alert($validation, 'alert', $config);
$alert2 = self::_alert($validation, 'alert2', $config);
$alert3 = self::_alert($validation, 'alert3', $config);
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
if (isset($validation->fieldnames) && $validation->fieldnames) {
$extra .= '&avWhere=' . str_replace('||', ',', $validation->fieldnames);
$extraData2 = '"extraDataDynamic": "#' . str_replace('||', ',#', $validation->fieldnames) . '",';
$and = self::_where($validation->table, $validation->fieldnames, $config['storages'][$validation->table], 'object');
}
if ($field->value) {
$pk = (int) JCckDatabase::loadResult('SELECT ' . $validation->key . ' FROM ' . $validation->table . ' WHERE ' . $validation->column . '="' . JCckDatabase::escape($field->value) . '"' . $and);
$extra .= '&avKey=' . $validation->key . '&avPk=' . $pk . '&avPv=' . htmlspecialchars(str_replace(array('<', '>', "'"), array('%26lt;', '%26gt;', '%27'), $field->value));
}
$rule = '
"' . $name . '":{
"url": "' . JUri::base() . 'index.php?option=com_cck&task=ajax&format=raw&file=/plugins/cck_field_validation/ajax_availability/assets/ajax/script.php",
"extraData": "avTable=' . str_replace('#__', '', $validation->table) . '&avColumn=' . $validation->column . $extra . '",
' . $extraData2 . '
"alertText": "' . $prefix . $alert . '",
"alertTextOk": "' . $prefix . $alert2 . '",
"alertTextLoad": "' . $prefix . $alert3 . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = 'ajax[' . $name . ']';
}
示例3: prepareDisplay
protected function prepareDisplay($preconfig)
{
if (JCck::getConfig_Param('debug', 0)) {
jimport('joomla.error.profiler');
$profiler = new JProfiler();
}
$app = JFactory::getApplication();
$this->form = $this->get('Form');
$this->option = $app->input->get('option', '');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$option = $this->option;
$params = new JRegistry();
$view = $this->getName();
$isNew = 1;
$live = '';
$lives = array();
$variation = '';
jimport('cck.base.form.form');
include_once JPATH_LIBRARIES_CCK . '/base/form/form_inc.php';
if (isset($config['id'])) {
JFactory::getSession()->set('cck_hash_seblod_form', JApplication::getHash($id . '|' . $type->name . '|' . $config['id']));
}
$this->config =& $config;
$this->data =& $data;
$this->id =& $id;
$this->isNew =& $isNew;
$this->params =& $params;
$this->stage =& $stage;
$this->type =& $type;
$title = isset($type->title) ? $type->title : '';
$name = isset($type->name) ? $type->name : '';
$this->addToolbar($title, $name);
}
示例4: g_onCCK_Storage_LocationStore
public function g_onCCK_Storage_LocationStore($location, $default, $pk, &$config, $params = array())
{
if (!$pk) {
return;
}
static $already = 0;
$config['author'] = (int) $config['author'] > 0 ? $config['author'] : JCck::getConfig_Param('integration_user_default_author', 42);
$config['parent'] = isset($config['parent']) && (int) $config['parent'] > 0 ? $config['parent'] : 0;
$table = $location['_']->table;
// Core
if (!$already) {
if (isset($params['bridge']) && $params['bridge']) {
if (!isset($params['bridge_default_title'])) {
$params['bridge_default_title'] = '';
}
if (!isset($params['bridge_default_title_mode'])) {
$params['bridge_default_title_mode'] = 0;
}
if ($params['bridge'] == 1) {
self::g_doBridge('joomla_article', $pk, $location, $config, $params);
} elseif ($params['bridge'] == 2) {
self::g_doBridge('joomla_category', $pk, $location, $config, $params);
}
} else {
$core = JCckTable::getInstance('#__cck_core', 'id');
$core->load($config['id']);
$core->cck = $config['type'];
if (!$core->pk) {
$core->date_time = JFactory::getDate()->toSql();
}
$core->pk = $pk;
$core->storage_location = isset($location['_']->location) ? $location['_']->location : JCckDatabase::loadResult('SELECT storage_location FROM #__cck_core_types WHERE name = "' . $config['type'] . '"');
$core->author_id = $config['author'];
$core->parent_id = $config['parent'];
if (isset($config['storages']['#__cck_core']['store_id'])) {
$core->store_id = $config['storages']['#__cck_core']['store_id'];
}
$core->storeIt();
}
if (!(isset($config['component']) && $config['component'] == 'com_cck_importer')) {
$already = 1;
}
}
// More
if ($table && $table != $default) {
$more = JCckTable::getInstance($table, 'id');
$more->load($pk, true);
if (isset($more->cck)) {
$more->cck = $config['type'];
}
$more->bind($config['storages'][$table]);
$more->check();
$more->store();
}
if (!isset($config['primary'])) {
$config['primary'] = $location['_']->location;
}
}
示例5: __construct
function __construct($path)
{
$this->_quality_jpg = JCck::getConfig_Param('media_quality_jpeg', 90);
$this->_quality_png = JCck::getConfig_Param('media_quality_png', 3);
$this->_pathinfo = pathinfo($path);
$this->_extension = strtolower($this->_pathinfo['extension']);
$this->_resource = $this->_createResource($this->_extension, $path);
list($this->_width, $this->_height) = getimagesize($path);
$this->_ratio = $this->_width / $this->_height;
}
示例6: uninstall
function uninstall($parent)
{
// Post Install Log
self::_postInstallMessage('uninstall', $parent);
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$db->setQuery('SELECT extension_id FROM #__extensions WHERE type = "package" AND element = "pkg_cck"');
$eid = $db->loadResult();
$db->setQuery('SELECT extension_id FROM #__extensions WHERE type = "plugin" AND element = "cck" AND folder="system"');
$cck = $db->loadResult();
// Backup or Drop SQL Tables
$prefix = $db->getPrefix();
$tables = $db->getTableList();
$tables = array_flip($tables);
$uninstall_sql = (int) JCck::getConfig_Param('uninstall_sql', '');
if (count($tables)) {
$length = strlen($prefix);
$app->cck_nosql = true;
foreach ($tables as $k => $v) {
$pos = strpos($k, $prefix . 'cck_');
if ($pos !== false && $pos == 0) {
$k2 = $prefix . '_' . substr($k, $length);
if (isset($tables[$k2])) {
$db->setQuery('DROP TABLE ' . $k2);
$db->execute();
}
if ($uninstall_sql == 1) {
$db->setQuery('DROP TABLE ' . $k);
$db->execute();
} else {
$db->setQuery('RENAME TABLE ' . $k . ' TO ' . $k2);
$db->execute();
}
}
}
}
// Uninstall FULL PACKAGE only if package exists && system plugin exists..
if ($eid && $cck) {
$manifest = JPATH_ADMINISTRATOR . '/manifests/packages/pkg_cck.xml';
if (JFile::exists($manifest)) {
$xml = JFactory::getXML($manifest);
// Keep it this way until platform 13.x
}
if (isset($xml->files)) {
unset($xml->files->file[3]);
$xml->asXML($manifest);
}
jimport('joomla.installer.installer');
$installer = JInstaller::getInstance();
$installer->uninstall('package', $eid);
}
}
示例7: __construct
function __construct($path)
{
$this->_quality_jpg = JCck::getConfig_Param('media_quality_jpeg', 90);
$this->_quality_png = JCck::getConfig_Param('media_quality_png', 3);
$this->_pathinfo = pathinfo($path);
$this->_extension = strtolower($this->_pathinfo['extension']);
if (in_array($this->_extension, array('jpg', 'jpeg', 'tiff'))) {
$this->_exif = exif_read_data($path, 0, true);
}
$this->_resource = $this->_createResource($this->_extension, $path);
list($this->_width, $this->_height) = getimagesize($path);
$this->_ratio = $this->_width / $this->_height;
}
示例8: onCCK_Field_ValidationPrepareForm
public static function onCCK_Field_ValidationPrepareForm(&$field, $fieldId, &$config)
{
if (self::$type != $field->required) {
if (strpos($field->required, self::$type . '[') !== false) {
$name = 'groupRequired';
$fieldId = explode('[', $field->required);
$fieldId = substr($fieldId[1], 0, -1);
$required = 'groupRequired[' . $fieldId . ']';
$required2 = 'groupRequire';
} else {
return;
}
} else {
$name = $field->required;
$required = $field->required;
$required2 = 'require';
}
if ($field->required_alert != '') {
$name = $name . '_' . $fieldId;
$alert = $field->required_alert;
if ($config['doTranslation']) {
if (trim($alert)) {
$alert = JText::_('COM_CCK_' . str_replace(' ', '_', trim($alert)));
}
}
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
$rule = '
"' . $name . '":{
"regex": ' . self::$regex . ',
"alertText":"' . $prefix . $alert . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = $required2 . '[' . $name . ']';
} else {
$alert = JText::_('PLG_CCK_FIELD_VALIDATION_' . $name . '_ALERT');
$alert2 = JText::_('PLG_CCK_FIELD_VALIDATION_' . self::$type . '_ALERT2');
$alert3 = JText::_('PLG_CCK_FIELD_VALIDATION_' . self::$type . '_ALERT3');
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
$rule = '
"' . $name . '":{
"regex":' . self::$regex . ',
"alertText":"' . $prefix . $alert . '",
"alertTextCheckboxe":"' . $prefix . $alert2 . '",
"alertTextCheckboxMultiple":"' . $prefix . $alert3 . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = $required;
}
}
示例9: onCCK_FieldPrepareContent
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array())
{
if (self::$type != $field->type) {
return;
}
parent::g_onCCK_FieldPrepareContent($field, $config);
// Process
if ($field->state) {
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$postpone = false;
if (count($doc->_links)) {
foreach ($doc->_links as $k => $link) {
if ($link['relation'] == 'canonical') {
unset($doc->_links[$k]);
}
}
}
if ($field->options2 != '') {
$fieldname = '';
$fieldname2 = '';
$options2 = new JRegistry($field->options2);
$location = $config['location'] ? $config['location'] : 'joomla_article';
if ($options2->get('content') == '2') {
$postpone = true;
$fieldname = $options2->get('content_fieldname');
}
if ($options2->get('itemid') == '-2') {
$fieldname2 = $options2->get('itemid_fieldname');
$itemId = $config['Itemid'];
$postpone = true;
} else {
$itemId = $options2->get('itemid', $config['Itemid']);
}
if ($postpone !== false) {
parent::g_addProcess('beforeRenderContent', self::$type, $config, array('name' => $field->name, 'fieldname' => $fieldname, 'itemId' => $itemId, 'fieldname2' => $fieldname2, 'location' => $location, 'sef' => $options2->get('sef', JCck::getConfig_Param('sef'))));
} elseif ($config['pk']) {
$uri = JUri::getInstance();
$domain = $uri->toString(array('scheme', 'host', 'port'));
$link = JCck::callFunc_Array('plgCCK_Storage_Location' . $location, 'getRoute', array($config['pk'], $options2->get('sef', JCck::getConfig_Param('sef')), $options2->get('itemid', $config['Itemid']), $config));
$doc->addHeadLink($domain . $link, 'canonical');
$app->cck_canonical_url = $link;
}
}
$app->cck_canonical = true;
}
$field->display = 0;
$field->value = '';
}
示例10: addValidation
public static function addValidation($rules, $options, $id = '', &$config = array())
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
if (!$id) {
$id = 'seblod_form';
}
if (empty($rules)) {
$rules = '';
}
$rules = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $rules);
if (is_object($options)) {
$bgcolor = $options->get('validation_background_color', JCck::getConfig_Param('validation_background_color', ''));
$color = $options->get('validation_color', JCck::getConfig_Param('validation_color', ''));
$position = $options->get('validation_position', JCck::getConfig_Param('validation_position', 'topRight'));
$scroll = $options->get('validation_scroll', JCck::getConfig_Param('validation_scroll', 1)) ? 'scroll:true' : 'scroll:false';
if ($color != '') {
if ($position == 'inline' && $id != '_') {
$doc->addStyleDeclaration('#' . $id . ' .formError .formErrorContent{color: ' . $color . '}');
} else {
$doc->addStyleDeclaration('.formError .formErrorContent{color: ' . $color . '}');
}
}
if ($position != 'inline' && $bgcolor != '') {
$css = '.formError .formErrorContent{background: ' . $bgcolor . '}';
if ($position == 'topLeft' || $position == 'topRight') {
$css .= '.formError .formErrorArrow{border-color: ' . $bgcolor . ' transparent transparent transparent;}';
} else {
$css .= '.formError .formErrorArrow.formErrorArrowBottom{border-color: transparent transparent ' . $bgcolor . ' transparent;}';
}
$doc->addStyleDeclaration($css);
}
$options = '{' . $scroll . ',promptPosition:"' . $position . '"}';
} else {
$options = '{}';
}
$js = $id == '_' ? '' : '$("#' . $id . '").validationEngine(' . $options . ');';
$js = 'jQuery(document).ready(function($){ $.validationEngineLanguage.newLang({' . $rules . '});' . $js . ' });';
if ($app->input->get('tmpl') == 'raw') {
echo '<link rel="stylesheet" href="' . JURI::root(true) . '/media/cck/css/cck.validation-3.6.0.css" type="text/css" />';
echo '<script src="' . JURI::root(true) . '/media/cck/js/cck.validation-3.5.0.min.js" type="text/javascript"></script>';
echo '<script type="text/javascript">' . $js . '</script>';
} else {
$doc->addStyleSheet(JURI::root(true) . '/media/cck/css/cck.validation-3.6.0.css');
$doc->addScript(JURI::root(true) . '/media/cck/js/cck.validation-3.5.0.min.js');
$doc->addScriptDeclaration($js);
}
}
示例11: prepareDisplay
function prepareDisplay()
{
$app = JFactory::getApplication();
$model = $this->getModel();
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->option = $app->input->get('option', '');
$this->state = $this->get('State');
// Check Errors
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->isNew = @$this->item->id > 0 ? 0 : 1;
$this->item->published = Helper_Admin::getSelected($this->vName, 'state', $this->item->published, 1);
$this->item->type = $this->state->get('type', '2,7');
$this->item->fields = JCck::getConfig_Param('multisite_options', array());
$this->item->options = $this->item->options ? JCckDev::fromJSON($this->item->options) : array();
Helper_Admin::addToolbarEdit($this->vName, _C5_TEXT, array('isNew' => $this->isNew, 'folder' => 0, 'checked_out' => $this->item->checked_out));
}
示例12: checkLatest
public static function checkLatest($type, $pk)
{
$latest = JCckDatabase::loadResult('SELECT date_time FROM #__cck_core_versions WHERE e_type = "' . $type . '" AND e_id = ' . $pk . ' ORDER BY date_time DESC');
if (!$latest) {
return true;
}
$current = JFactory::getDate()->toSql();
$diff = round(abs(strtotime($current) - strtotime($latest)) / 60, 2);
$time = (int) JCck::getConfig_Param('version_auto_time', 180);
$time_unit = (int) JCck::getConfig_Param('version_auto_unit', 0);
if ($time_unit == 2) {
$diff = $diff / 1440;
} elseif ($time_unit == 1) {
$diff = $diff / 60;
}
if ($diff > $time) {
return true;
}
return false;
}
示例13: onCCK_Field_ValidationPrepareForm
public static function onCCK_Field_ValidationPrepareForm(&$field, $fieldId, &$config)
{
if (self::$type != $field->required) {
return;
}
if ($field->required_alert != '') {
$name = self::$type . '_' . $fieldId;
$alert = $field->required_alert;
if ($config['doTranslation']) {
if (trim($alert)) {
$alert = JText::_('COM_CCK_' . str_replace(' ', '_', trim($alert)));
}
}
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
$rule = '
"' . $name . '":{
"regex": ' . self::$regex . ',
"alertText":"' . $prefix . $alert . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = 'require[' . $name . ']';
} else {
//$lang = JFactory::getLanguage();
//$lang->load( 'plg_cck_field_validation_'.self::$type, JPATH_ADMINISTRATOR, null, false, true );
$name = self::$type;
$alert = JText::_('PLG_CCK_FIELD_VALIDATION_' . self::$type . '_ALERT');
$alert2 = JText::_('PLG_CCK_FIELD_VALIDATION_' . self::$type . '_ALERT2');
$alert3 = JText::_('PLG_CCK_FIELD_VALIDATION_' . self::$type . '_ALERT3');
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
$rule = '
"' . $name . '":{
"regex":' . self::$regex . ',
"alertText":"' . $prefix . $alert . '",
"alertTextCheckboxe":"' . $prefix . $alert2 . '",
"alertTextCheckboxMultiple":"' . $prefix . $alert3 . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = 'required';
}
}
示例14: onCCK_Field_ValidationPrepareForm
public static function onCCK_Field_ValidationPrepareForm(&$field, $fieldId, &$config)
{
if (self::$type != $field->validation) {
return;
}
$validation = parent::g_getValidation($field->validation_options);
if (empty($validation->field)) {
return;
}
if ($validation->alert != '') {
$name = 'confirmed_' . $fieldId;
$alert = $validation->alert;
if ($config['doTranslation']) {
if (trim($alert)) {
$alert = JText::_('COM_CCK_' . str_replace(' ', '_', trim($alert)));
}
}
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
$rule = '
"' . $name . '":{
"regex": "' . $validation->field . '",
"alertText":"' . $prefix . $alert . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = 'confirm[' . $name . ']';
} else {
$lang = JFactory::getLanguage();
$lang->load('plg_cck_field_validation_' . self::$type, JPATH_ADMINISTRATOR, null, false, true);
$name = 'confirmed';
$alert = JText::_('PLG_CCK_FIELD_VALIDATION_' . self::$type . '_ALERT');
$prefix = JCck::getConfig_Param('validation_prefix', '* ');
$rule = '
"' . $name . '":{
"regex": ' . self::$regex . ',
"alertText":"' . $prefix . $alert . '"}
';
$config['validation'][$name] = $rule;
$field->validate[] = 'confirmed[' . $validation->field . ']';
}
}
示例15: revert
public function revert($pk, $type)
{
$db = $this->getDbo();
$table = $this->getTable();
if (!$pk || !$type) {
return false;
}
$table->load($pk);
if (JCck::getConfig_Param('version_revert', 1) == 1) {
Helper_Version::createVersion($type, $table->e_id, JText::sprintf('COM_CCK_VERSION_AUTO_BEFORE_REVERT', $table->e_version));
}
$row = JTable::getInstance($type, 'CCK_Table');
$row->load($table->e_id);
$core = JCckDev::fromJSON($table->e_core);
if (isset($row->asset_id) && $row->asset_id && isset($core['rules'])) {
JCckDatabase::execute('UPDATE #__assets SET rules = "' . $db->escape($core['rules']) . '" WHERE id = ' . (int) $row->asset_id);
}
// More
if ($type == 'search') {
$clients = array(1 => 'search', 2 => 'filter', 3 => 'list', 4 => 'item', 5 => 'order');
} else {
$clients = array(1 => 'admin', 2 => 'site', 3 => 'intro', 4 => 'content');
}
foreach ($clients as $i => $client) {
$name = 'e_more' . $i;
$this->_revert_more($type, $client, $table->e_id, $table->{$name});
}
// Override
if ($row->version && $row->version != $table->e_version) {
$core['version'] = ++$row->version;
}
$core['checked_out'] = 0;
$core['checked_out_time'] = '0000-00-00 00:00:00';
$row->bind($core);
$row->check();
$row->store();
return true;
}