本文整理匯總了PHP中JCck::loadjQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCck::loadjQuery方法的具體用法?PHP JCck::loadjQuery怎麽用?PHP JCck::loadjQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCck
的用法示例。
在下文中一共展示了JCck::loadjQuery方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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;
}
示例2: getInput
protected function getInput()
{
$format = (string) $this->element['js_format'];
if ($format != 'raw') {
JCck::loadjQuery(true, true, array('cck.dev-3.6.0.min.js', 'jquery.json.min.js', 'jquery.ui.effects.min.js'));
}
return $this->_addScripts($this->id, array('appendTo' => (string) $this->element['js_appendto'], 'isVisibleWhen' => (string) $this->element['js_isvisiblewhen'], 'isDisabledWhen' => (string) $this->element['js_isdisabledwhen']), $format);
}
示例3: getInput
protected function getInput()
{
JPluginHelper::importPlugin('cck_field');
require_once JPATH_PLUGINS . '/cck_field_validation/required/required.php';
$attributes = isset($this->element['cck_attributes']) ? (string) $this->element['cck_attributes'] : '';
$name = (string) $this->element['construction'];
$name2 = (string) $this->element['construction2'];
$options = isset($this->element['cck_options']) ? (string) $this->element['cck_options'] : '';
$suffix = (string) $this->element['more'] ? '<span class="variation_value">' . (string) $this->element['more'] . '</span>' : '';
$suffix2 = (string) $this->element['more2'] ? '<span class="variation_value">' . (string) $this->element['more2'] . '</span>' : '';
$selectlabel = isset($this->element['cck_selectlabel']) ? (string) $this->element['cck_selectlabel'] : 'undefined';
if (!$name) {
return;
}
$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, array('cck.dev-3.3.0.min.js', 'jquery.json.min.js', 'jquery.ui.effects.min.js'));
}
$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;
if ($attributes != '') {
if ($field->attributes) {
$field->attributes .= ' ' . htmlspecialchars(str_replace("'", '"', $attributes));
} else {
$field->attributes = htmlspecialchars(str_replace("'", '"', $attributes));
}
}
if ($options != '') {
$field->options = $options;
}
if ($selectlabel != 'undefined') {
$field->selectlabel = $selectlabel;
}
$field = JCckDevField::get($field, $this->value, $config, $inherit);
$more = '';
if ($name2) {
$field2 = JCckDevField::getObject($name2);
$storage_field2 = $field2->storage_field;
$field2->storage_field = str_replace($storage_field, $storage_field2, $this->name);
$field2 = JCckDevField::get($field2, (string) $this->element['value2'], $config, $inherit);
$more = $field2->form;
}
$script = $this->_addScripts($this->id, array('appendTo' => (string) $this->element['js_appendto'], 'isVisibleWhen' => (string) $this->element['js_isvisiblewhen'], 'isDisabledWhen' => (string) $this->element['js_isdisabledwhen']), $format);
return $field->form . $suffix . $more . $suffix2 . $script;
}
示例4: fetchButton
public function fetchButton($type = 'CckModalBox', $name = '', $text = '', $url = '', $width = 820, $height = 400, $top = 0, $left = 0)
{
JCck::loadjQuery();
// Helper_Include::addColorbox( $width, $height, true, 'cbox_button', ', scrolling:false' );
$class = $this->fetchIconClass($name);
$class2 = $name == 'apply' || $name == 'new' ? 'btn btn-small btn-success' : 'btn btn-small';
$text = JText::_($text);
$url = $this->_getCommand($name, $url, $width, $height, $top, $left);
$html = '<a class="cbox_button ' . $class2 . '" href="' . $url . '">' . '<span class="' . $class . '"></span>' . "\n" . $text . '</a>';
return $html;
}
示例5: addDependencies
public static function addDependencies($view, $layout, $tmpl = '')
{
$doc = JFactory::getDocument();
$script = $tmpl == 'ajax' ? false : true;
if ($script !== false) {
if (JCck::on()) {
JHtml::_('behavior.framework', false);
JHtml::_('bootstrap.tooltip');
}
JCck::loadjQuery(true, true, true);
}
Helper_Include::addStyleSheets(true);
}
示例6: quickSession
public static function quickSession($options, $id = 'featured_session')
{
$doc = JFactory::getDocument();
$css = '
ul.toolbar-tiplist {padding: 0px; margin-left:0px; margin-right:0px;}
ul.toolbar-tiplist li { list-style: none; padding: 5px;}
ul.toolbar-tiplist li:hover {background-color: #ffffff; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px;}
.ui-tooltip-grey .ui-tooltip-content{background-color: #ffffff;}
.ui-tooltip-rounded .ui-tooltip-titlebar{-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px;}
.ui-tooltip-rounded .ui-tooltip-titlebar + .ui-tooltip-content{-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px;}
';
$doc->addStyleDeclaration($css);
$doc->addStyleSheet(JURI::root(true) . '/media/cck/scripts/jquery-qtip/css/jquery.qtip.css');
JCck::loadjQuery();
$doc->addScript(JURI::root(true) . '/media/cck/scripts/jquery-qtip/js/jquery.qtip.min.js');
$title = JText::_('COM_CCK_SESSIONS_SAVE_SELECT');
$html = '';
$where = 'extension="' . $options['extension'] . '"';
if (isset($options['folder'])) {
$where .= 'type="' . $options['folder'] . '"';
}
if (isset($options['type'])) {
$where .= 'type="' . $options['type'] . '"';
}
$items = JCckDatabase::loadObjectList('SELECT id, title, type, options FROM #__cck_more_sessions WHERE ' . $where . ' ORDER BY title');
if (!count($items)) {
return;
}
foreach ($items as $item) {
$html .= '<li><a class="featured_sessions" href="javascript:void(0);" mydata="' . $item->type . '"' . 'mydata2="' . htmlspecialchars($item->options) . '">' . $item->title . '</a>' . '<img class="featured_sessions_del" src="' . JROOT_MEDIA_CCK . '/images/14/icon-14-trash.png" mydata="' . $item->id . '" /></li>';
}
// Tooltip
$html = '<div><ul class="toolbar-tiplist">' . $html . '</ul></div>' . '<div class="clr"></div>';
$search = array('.', '<', '>', '"', '%', ';');
$replace = array('\\.', '\\<', '\\>', '\\"', '\\%', '\\;');
$html = preg_replace("/(\r\n|\n|\r)/", " ", $html);
$html = str_replace($search, $replace, $html);
$js = '
jQuery(document).ready(function($){
$("#' . $id . '").qtip({
prerender: true,
content: { text: "' . $html . '", title: { text: "' . $title . '" } },
hide: { event: "unfocus" },
style: { tip: true, classes: "ui-tooltip-grey ui-tooltip-rounded" },
position: { at: "right center", my: "left center", adjust: { x: 23 } }
});
});
';
$doc->addScriptDeclaration($js);
}
示例7: display
public function display($tpl = NULL)
{
$app = JFactory::getApplication();
$preconfig = array();
$preconfig['action'] = '';
$preconfig['client'] = 'site';
$preconfig['formId'] = 'seblod_form';
$preconfig['submit'] = 'JCck.Core.submit';
$preconfig['task'] = $app->input->get('task', '');
$preconfig['type'] = $app->input->get('type', '');
$preconfig['url'] = '';
JCck::loadjQuery();
$this->prepareDisplay($preconfig);
parent::display($tpl);
}
示例8: display
public function display($tpl = NULL)
{
$app = JFactory::getApplication();
$preconfig = array();
$preconfig['action'] = '';
$preconfig['client'] = 'search';
$preconfig['search'] = $app->input->get('search', '');
$preconfig['itemId'] = 0;
$preconfig['task'] = $app->input->get('task', 'search');
$preconfig['doPagination'] = 1;
$preconfig['formId'] = 'adminForm';
$preconfig['submit'] = 'JCck.Core.submit';
JCck::loadjQuery();
$this->prepareDisplay($preconfig);
parent::display($tpl);
}
示例9: display
public function display($tpl = NULL)
{
$app = JFactory::getApplication();
if ($this->getlayout() != 'select') {
$preconfig = array();
$preconfig['action'] = '';
$preconfig['client'] = 'admin';
$preconfig['formId'] = 'seblod_form';
$preconfig['submit'] = 'JCck.Core.submit';
$preconfig['task'] = $app->input->get('task', '');
$preconfig['type'] = $app->input->get('type', '');
$preconfig['url'] = JFactory::getURI()->toString();
JCck::loadjQuery();
Helper_Include::addStyleSheets(false);
$this->prepareDisplay($preconfig);
}
parent::display($tpl);
}
示例10: display
public function display($tpl = NULL)
{
$app = JFactory::getApplication();
$layout = $app->input->get('tmpl');
$uniqId = '';
if ($layout == 'component' || $layout == 'raw') {
$uniqId = '_' . $layout;
}
$preconfig = array();
$preconfig['action'] = '';
$preconfig['client'] = 'site';
$preconfig['formId'] = 'seblod_form' . $uniqId;
$preconfig['submit'] = 'JCck.Core.submit' . $uniqId;
$preconfig['task'] = $app->input->get('task', '');
$preconfig['type'] = $app->input->get('type', '');
$preconfig['url'] = '';
JCck::loadjQuery();
$this->prepareDisplay($preconfig);
parent::display($tpl);
}
示例11: render
public function render()
{
if ($this->type == '') {
return '';
}
/*
$config = JCckDev::init( array(), true, array( 'item'=>$this->item, 'tmpl'=>'ajax' ) );
Helper_Include::addDependencies( $this->getName(), $this->getLayout(), 'ajax' );
*/
JCck::loadjQuery(true, true, array('cck.dev-3.6.0.min.js'));
$config = array('asset' => '', 'asset_id' => 0, 'client' => '', 'doTranslation' => 0, 'doValidation' => 0, 'fields' => array(), 'inherit' => 'core_fields', 'item' => '', 'pk' => 0, 'validation' => array());
$file = JPATH_PLUGINS . '/cck_field/' . $this->type . '/tmpl/edit.php';
if (!$this->_isFile($file)) {
return '';
}
JFactory::getLanguage()->load('plg_cck_field_' . $this->type, JPATH_ADMINISTRATOR, null, false, true);
ob_start();
include_once $file;
return ob_get_clean();
}
示例12: _addScripts
protected static function _addScripts()
{
static $loaded = 0;
if ($loaded) {
return;
}
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$loaded = 1;
JCck::loadjQuery();
JCck::loadjQueryUI();
if ($app->input->get('tmpl') == 'raw') {
echo '<script src="' . self::$path . 'assets/js/script.js' . '" type="text/javascript"></script>';
} else {
$doc->addScript(self::$path . 'assets/js/script.js');
}
}
示例13: _addScripts
protected static function _addScripts($params, $options)
{
$doc = JFactory::getDocument();
$height = '';
$width = '';
if ($options['image_custom'] > 0) {
$dim = array('w' => array(1 => 'width', 2 => 'innerWidth', 3 => 'maxWidth'), 'h' => array(1 => 'height', 2 => 'innerHeight', 3 => 'maxHeight'));
$width = $dim['w'][$options['image_custom']] . ':' . $options['image_width'];
$height = ', ' . $dim['h'][$options['image_custom']] . ':' . $options['image_height'];
}
$options = '{' . $width . $height . '}';
JCck::loadjQuery();
JCck::loadModalBox();
if ($params['id']) {
$js = 'jQuery(document).ready(function($){ $("a[rel=\'colorBox' . $params['id'] . '\']").colorbox(' . $options . '); });';
$doc->addScriptDeclaration($js);
}
}
示例14: addWarning
public static function addWarning($type)
{
$doc = JFactory::getDocument();
$text = JText::_('LIB_CCK_INTEGRATION_WARNING_COPY');
if (JCck::on()) {
$js = 'jQuery(document).ready(function(){ if(jQuery("#batch-category-id")) {jQuery("#batch-category-id").parent().after("' . addslashes('<em>' . $text . '</em>') . '"); }});';
} else {
$html = '<img id="cck_warning" class="hasTip2" title="' . htmlspecialchars($text, ENT_COMPAT, 'UTF-8') . '"' . ' src="components/com_cck/assets/images/16/icon-16-notice.png" alt="Copy is not supported yet." />';
$js = 'jQuery(document).ready(function(){ if(jQuery("#batch-category-id")) {jQuery("#batch-category-id").after("' . addslashes($html) . '"); var JTooltips = new Tips($$(\'.hasTip2\'), { maxTitleChars: 50, fixed: false}); }});';
}
JCck::loadjQuery();
$doc->addScriptDeclaration($js);
}
示例15: define
if ($show && JCckDevHelper::matchUrlVars($show) === false) {
return;
}
if ($hide && JCckDevHelper::matchUrlVars($hide) !== false) {
return;
}
$app = JFactory::getApplication();
$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';
$preconfig = array();
$preconfig['action'] = '';
$preconfig['client'] = 'search';
$preconfig['formId'] = $formId;
$preconfig['submit'] = 'JCck.Core.submit_' . $uniqId;
$preconfig['search'] = $params->get('search', '');
$preconfig['itemId'] = '';
$preconfig['task'] = 'search';
$preconfig['show_form'] = 1;
$preconfig['auto_redirect'] = 0;
$preconfig['limit2'] = $params->get('limit2', 5);
$preconfig['ordering'] = $params->get('ordering', '');
$preconfig['ordering2'] = $params->get('ordering2', '');