当前位置: 首页>>代码示例>>PHP>>正文


PHP JCckPluginField::g_addProcess方法代码示例

本文整理汇总了PHP中JCckPluginField::g_addProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP JCckPluginField::g_addProcess方法的具体用法?PHP JCckPluginField::g_addProcess怎么用?PHP JCckPluginField::g_addProcess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JCckPluginField的用法示例。


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

示例1: 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 = '';
 }
开发者ID:kenyonjohnston,项目名称:hott_theater,代码行数:49,代码来源:cck_canonical.php

示例2: onCCK_FieldPrepareStore

 public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false)
 {
     if (self::$type != $field->type) {
         return;
     }
     // Init
     if (count($inherit)) {
         $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name;
     } else {
         $name = $field->name;
     }
     // Validate
     parent::g_onCCK_FieldPrepareStore_Validation($field, $name, $value, $config);
     if ($field->state != 'disabled') {
         parent::g_addProcess('afterStore', self::$type, $config, array('name' => $field->storage_field2 ? $field->storage_field2 : $field->storage_field, 'value' => $value));
     }
     // Set or Return
     if ($return === true) {
         return $value;
     }
     if ($value > 0) {
         $field->text = JCckDatabase::loadResult('SELECT title FROM ' . self::$table . ' WHERE id =' . (int) $value);
     }
     $field->value = $value;
     parent::g_onCCK_FieldPrepareStore($field, $name, $value, $config);
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:26,代码来源:joomla_article.php

示例3: onCCK_FieldPrepareStore

 public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false)
 {
     if (self::$type != $field->type) {
         return;
     }
     // Init
     if (count($inherit)) {
         $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name;
     } else {
         $name = $field->name;
     }
     $options2 = JCckDev::fromJSON($field->options2);
     $siteName = JFactory::getConfig()->get('sitename');
     $valid = 0;
     $send = isset($options2['send']) && $field->state != 'disabled' ? $options2['send'] : 0;
     $send_field = isset($options2['send_field']) && strlen($options2['send_field']) > 0 ? $options2['send_field'] : 0;
     $isNew = $config['pk'] ? 0 : 1;
     $sender = 0;
     switch ($send) {
         case 0:
             $sender = 0;
             break;
         case 1:
             if (!$config['pk']) {
                 $sender = 1;
             }
             break;
         case 2:
             if ($config['pk']) {
                 $sender = 1;
             }
             break;
         case 3:
             $sender = 1;
             break;
     }
     $subject = isset($options2['subject']) && $options2['subject'] ? $options2['subject'] : $siteName . '::' . JText::_('COM_CCK_EMAIL_GENERIC_SUBJECT');
     $message = isset($options2['message']) && $options2['message'] ? htmlspecialchars_decode($options2['message']) : JText::sprintf('COM_CCK_EMAIL_GENERIC_MESSAGE', $siteName);
     $message = strlen($options2['message']) > 0 ? htmlspecialchars_decode($options2['message']) : JText::sprintf('COM_CCK_EMAIL_GENERIC_MESSAGE', $siteName);
     $new_message = strlen($options2['message_field']) > 0 ? $options2['message_field'] : '';
     $dest = array();
     $from = isset($options2['from']) ? $options2['from'] : 0;
     $from_param = isset($options2['from_param']) ? $options2['from_param'] : '';
     $from_name = isset($options2['from_name']) ? $options2['from_name'] : 0;
     $from_name_param = isset($options2['from_name_param']) ? $options2['from_name_param'] : '';
     $cc = isset($options2['cc']) ? $options2['cc'] : 0;
     $cc_param = isset($options2['cc_param']) ? $options2['cc_param'] : '';
     $bcc = isset($options2['bcc']) ? $options2['bcc'] : 0;
     $bcc_param = isset($options2['bcc_param']) ? $options2['bcc_param'] : '';
     $moredest = isset($options2['to_field']) ? $options2['to_field'] : '';
     $send_attach = isset($options2['send_attachment_field']) && strlen($options2['send_attachment_field']) > 0 ? $options2['send_attachment_field'] : 1;
     $moreattach = isset($options2['attachment_field']) && strlen($options2['attachment_field']) > 0 ? $options2['attachment_field'] : '';
     // Prepare
     if ($options2['to'] != '') {
         $to = self::_split($options2['to']);
         $dest = array_merge($dest, $to);
         $valid = 1;
     }
     if ($moredest) {
         $valid = 1;
     }
     if ($options2['to_admin'] != '') {
         $to_admin = count($options2['to_admin']) ? implode(',', $options2['to_admin']) : $options2['to_admin'];
         if (strpos($to_admin, ',') !== false) {
             $recips = explode(',', $to_admin);
             foreach ($recips as $recip) {
                 $recip_mail = JCckDatabase::loadResult('SELECT email FROM #__users WHERE block=0 AND id=' . $recip);
                 if ($recip_mail) {
                     $dest[] = $recip_mail;
                     $valid = 1;
                 }
             }
         } else {
             $recip_mail = JCckDatabase::loadResult('SELECT email FROM #__users WHERE block=0 AND id=' . $to_admin);
             if ($recip_mail) {
                 $dest[] = $recip_mail;
                 $valid = 1;
             }
         }
     }
     if ($value) {
         // if () TODO check multiple
         $m_value = self::_split($value);
         $m_value_size = count($m_value);
         if ($m_value_size > 1) {
             for ($i = 0; $i < $m_value_size; $i++) {
                 $dest[] = $m_value[$i];
             }
         } else {
             $dest[] = $value;
         }
         $valid = 1;
     }
     // Validate
     parent::g_onCCK_FieldPrepareStore_Validation($field, $name, $value, $config);
     // Add Process
     if (($sender || $send_field) && $valid) {
         parent::g_addProcess('afterStore', self::$type, $config, array('isNew' => $isNew, 'sender' => $sender, 'send_field' => $send_field, 'name' => $name, 'valid' => $valid, 'subject' => $subject, 'message' => $message, 'new_message' => $new_message, 'dest' => $dest, 'from' => $from, 'from_param' => $from_param, 'from_name' => $from_name, 'from_name_param' => $from_name_param, 'cc' => $cc, 'cc_param' => $cc_param, 'bcc' => $bcc, 'bcc_param' => $bcc_param, 'moredest' => $moredest, 'send_attach' => $send_attach, 'moreattach' => $moreattach, 'format' => @(string) $options2['format']));
     }
     // Set or Return
//.........这里部分代码省略.........
开发者ID:kolydart,项目名称:SEBLOD,代码行数:101,代码来源:email.php

示例4: onCCK_FieldPrepareStore


//.........这里部分代码省略.........
             $unit_prod = 1000;
             break;
         case '2':
             $unit_prod = 1000000;
             break;
         default:
             $unit_prod = 1;
             break;
     }
     $maxsize = floatval($options2['max_size']) * $unit_prod;
     $filename = JFile::stripExt($userfile['name']);
     $userfile['name'] = str_replace($filename, JCckDev::toSafeSTRING($filename, JCck::getConfig_Param('media_characters', '-'), JCck::getConfig_Param('media_case', 0)), $userfile['name']);
     if (!$maxsize || $maxsize && $userfile['size'] < $maxsize) {
         if ($userfile && $userfile['name'] && $userfile['tmp_name']) {
             $ImageCustomName = $userfile['name'];
             $ImageCustomPath = '';
             if (@$options2['custom_path']) {
                 if (strrpos($imageCustomDir, '.') === false) {
                     $ImageCustomPath = $imageCustomDir == '' ? substr($itemPath, 0, strrpos($itemPath, '/') + 1) : ($imageCustomDir[strlen($imageCustomDir) - 1] == '/' ? $imageCustomDir : $imageCustomDir . '/');
                 } else {
                     $ImageCustomPath = substr($itemPath, 0, strrpos($itemPath, '/') + 1);
                 }
             }
             if (count($legal_ext)) {
                 $old_legal = strrpos($userfile['name'], '.') ? substr($userfile['name'], strrpos($userfile['name'], '.') + 1) : '';
                 $legal = $ImageCustomName == $userfile['name'] ? $old_legal : substr($ImageCustomName, strrpos($ImageCustomName, '.') + 1);
                 if ($old_legal && array_search($old_legal, $legal_ext) === false) {
                     JFactory::getApplication()->enqueueMessage($ImageCustomName . ' - ' . JText::_('COM_CCK_ERROR_LEGAL_EXTENSIONS'), 'notice');
                     $field->error = true;
                 } else {
                     if (trim($legal) != trim($old_legal)) {
                         $ImageCustomName .= '.' . trim($old_legal);
                     }
                 }
             }
             $file_path = $ImageCustomPath ? $ImageCustomPath : $options2['path'];
             $current_user = JFactory::getUser();
             $current_user_id = $current_user->id;
             if (strpos($file_path, '/' . $current_user_id . '/') === false) {
                 $file_path .= $options2['path_user'] && $current_user_id ? $current_user_id . '/' : '';
             }
             if (strpos($file_path, '/' . $config['pk'] . '/') === false) {
                 $file_path .= $options2['path_content'] && $config['pk'] > 0 ? $config['pk'] . '/' : '';
             }
             $value = $file_path . $ImageCustomName;
             $process = true;
         } else {
             if ($deleteBox == 1) {
                 $imageTitle = '';
                 $imageDesc = '';
             }
             if ($imageCustomDir != '' && strrpos($imageCustomDir, '.') > 0 && JFile::exists(JPATH_SITE . '/' . $imageCustomDir)) {
                 if (count($legal_ext)) {
                     $legal = strrpos($imageCustomDir, '.') ? substr($imageCustomDir, strrpos($imageCustomDir, '.') + 1) : '';
                     if ($legal && array_search($legal, $legal_ext) === false) {
                         JFactory::getApplication()->enqueueMessage($imageCustomDir . ' - ' . JText::_('COM_CCK_ERROR_LEGAL_EXTENSIONS'), 'notice');
                         $field->error = true;
                     }
                 }
                 $value = $imageCustomDir;
             } else {
                 if ($userfile['name']) {
                     JFactory::getApplication()->enqueueMessage(JText::_('COM_CCK_ERROR_INVALID_FILE'), "error");
                     $field->error = true;
                 }
                 if ($options2['path'] == $itemPath) {
                     $value = '';
                 } else {
                     if ($xk != -1 && !$array_x) {
                         $value = $itemPath == $options2['path'] ? '' : $itemPath;
                     } else {
                         $value = $itemPath;
                     }
                 }
             }
         }
     } else {
         JFactory::getApplication()->enqueueMessage($userfile['name'] . ' - ' . JText::_('COM_CCK_ERROR_MAX_SIZE'), 'notice');
         $field->error = true;
     }
     // Validate
     parent::g_onCCK_FieldPrepareStore_Validation($field, $name, $value, $config);
     if (isset($field->error) && $field->error === true) {
         return;
     }
     $imageTitle = $imageTitle ? addcslashes($imageTitle, '"') : '';
     $imageDesc = $imageDesc ? addcslashes($imageDesc, '"') : '';
     // Add Process
     if ($process === true) {
         $content_folder = $options2['path_content'] ? $options2['path_content'] : 0;
         $process_params = array('field_name' => $name, 'true_name' => $field->name, 'array_x' => $array_x, 'parent_name' => $parent, 'field_type' => $field->type, 'file_path' => $file_path, 'file_name' => $ImageCustomName, 'tmp_name' => $userfile['tmp_name'], 'xi' => $xi, 'content_folder' => $content_folder, 'options2' => $options2, 'storage' => $field->storage, 'storage_field' => $field->storage_field, 'storage_field2' => $field->storage_field2 ? $field->storage_field2 : $field->name, 'storage_table' => $field->storage_table, 'file_title' => $imageTitle, 'file_descr' => $imageDesc);
         parent::g_addProcess('afterStore', self::$type, $config, $process_params);
     }
     $value = !$options2['multivalue_mode'] || $imageTitle == '' && $imageDesc == '' ? $value : '{"image_location":"' . $value . '","image_title":"' . $imageTitle . '","image_description":"' . $imageDesc . '"}';
     if ($return === true) {
         return $value;
     }
     $field->value = $value;
     parent::g_onCCK_FieldPrepareStore($field, $name, $value, $config);
 }
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:101,代码来源: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;
     } else {
         $id = $field->name;
     }
     $value = $value != '' ? (int) $value : (int) $field->defaultvalue;
     $value = $value ? $value - 1 : 0;
     $group_id = $field->location != '' ? $field->location : 'cck_tabs1';
     // Prepare
     $form = '';
     if ($field->state) {
         parent::g_addProcess('beforeRenderForm', self::$type, $config, array('name' => $field->name, 'group_id' => $group_id, 'id' => $id, 'identifier' => $field->bool3, 'label' => $field->label, 'url_actions' => $field->bool2, 'value' => $value));
     }
     // Set
     $field->form = $form;
     // todo: '<div class="tabbable tabs-left">'
     $field->value = $field->label;
     $field->label = '';
     // Return
     if ($return === true) {
         return $field;
     }
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:31,代码来源:tabs.php

示例6: 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

示例7: 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_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="Joomla.submitform(\'' . $task . '\', document.getElementById(\'seblod_form\'));"';
     } else {
         if ($task == 'export') {
             parent::g_addProcess('beforeRenderForm', self::$type, $config, array('name' => $field->name, 'task' => $task, 'task_id' => $task_id));
         }
         $click = isset($config['submit']) ? ' onclick="' . $pre_task . $config['submit'] . '(\'' . $task . '\');return false;"' : '';
     }
     // $click	=	isset( $config['formId'] ) ? ' onclick="if (document.'.$config['formId'].'.boxchecked.value==0){alert(\''.addslashes( JText::_( 'JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST' ) ).'\');}else{ Joomla.submitbutton(\''.$task.'\')};return false;"' : '';
     $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 {
             $onclick = 'onclick="Joomla.submitform(\'cancel\', document.getElementById(\'seblod_form\'));"';
             $form .= $alt . '<a href="javascript: void(0);" ' . $onclick . ' title="' . JText::_('COM_CCK_CANCEL') . '">' . JText::_('COM_CCK_CANCEL') . '</a>';
         }
     } elseif ($field->bool2 == 2) {
         $alt = $field->bool3 ? ' ' . JText::_('COM_CCK_OR') . ' ' : "\n";
         $field2 = (object) array('link' => $options2['alt_link'], 'link_options' => $options2['alt_link_options'], 'id' => $id, 'name' => $name, 'text' => htmlspecialchars($options2['alt_link_text']), 'value' => '');
         JCckPluginLink::g_setLink($field2, $config);
         JCckPluginLink::g_setHtml($field2, 'text');
         $form .= $alt . $field2->html;
     }
     // Set
     if (!$field->variation) {
         $field->form = $form;
         if ($field->script) {
             parent::g_addScriptDeclaration($field->script);
         }
     } else {
         if ($field->variation == 'toolbar_button') {
             $field->form = '';
             $icon = isset($options2['icon']) && $options2['icon'] ? 'icon-' . $options2['icon'] : '';
             $html = '<button class="btn btn-small' . ($field->css ? ' ' . $field->css : '') . '" onclick="' . $pre_task . 'JCck.Core.submit(\'' . $task . '\')" href="#"><i class="' . $icon . '"></i> ' . $value . '</button>';
             JToolBar::getInstance('toolbar')->appendButton('Custom', $html, @$options2['icon']);
             // JToolBar::getInstance( 'toolbar' )->appendButton( 'Standard', $options2['icon'], $value, $task, true ); todo: check
         } else {
             parent::g_getDisplayVariation($field, $field->variation, $value, $value, $form, $id, $name, '<' . $tag, ' ', '', $config);
         }
     }
     $field->value = '';
     // Return
     if ($return === true) {
         return $field;
     }
 }
开发者ID:olafzieger,项目名称:joomla3.x-seblod-test,代码行数:98,代码来源:button_submit.php


注:本文中的JCckPluginField::g_addProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。