function itemCustomHead() { echo '<script type="text/javascript" src="' . osc_current_web_theme_js_url('jquery.validate.min.js') . '"></script>'; echo '<script type="text/javascript" src="' . osc_current_web_theme_js_url('tabber-minimized.js') . '"></script>'; ?> <?php if (osc_images_enabled_at_items()) { ItemForm::photos_javascript(); } ?> <?php }
function itemCustomHead() { echo '<script type="text/javascript" src="' . osc_current_web_theme_js_url('tabber-minimized.js') . '"></script>'; ?> <?php if (realestate_default_location_show_as() == 'dropdown') { ItemForm::location_javascript(); } else { ItemForm::location_javascript_new(); } ?> <?php if (osc_images_enabled_at_items()) { ItemForm::photos_javascript(); } ?> <!-- end only item-post.php --> <?php }
<label class="col-sm-3 control-label" for="contactEmail"><?php _e('E-mail', 'flatter'); ?> </label> <div class="col-sm-8"> <?php ItemForm::contact_email_text(); ?> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <div class="checkbox"> <label> <?php ItemForm::show_email_checkbox(); ?> <?php _e('Show e-mail on the listing page', 'flatter'); ?> </label> </div> </div> </div> <?php } ?> <?php if (osc_recaptcha_items_enabled()) { ?> <div class="form-group">
function customHead() { ?> <script type="text/javascript" src="<?php echo osc_current_admin_theme_js_url('jquery.validate.min.js'); ?> "></script> <?php ItemForm::location_javascript_new('admin'); ?> <script type="text/javascript"> // autocomplete users $(document).ready(function(){ $('#filter-select').change( function () { var option = $(this).find('option:selected').attr('value') ; // clean values $('#fPattern,#fUser,#fItemId').attr('value', ''); if(option == 'oPattern') { $('#fPattern').removeClass('hide'); $('#fUser, #fItemId').addClass('hide'); } else if(option == 'oUser'){ $('#fUser').removeClass('hide'); $('#fPattern, #fItemId').addClass('hide'); } else { $('#fItemId').removeClass('hide'); $('#fPattern, #fUser').addClass('hide'); } }); $('input[name="user"]').attr( "autocomplete", "off" ); $('#user,#fUser').autocomplete({ source: "<?php echo osc_admin_base_url(true); ?> ?page=ajax&action=userajax"+$('input[name="user"]').val(), // &term= minLength: 0, select: function( event, ui ) { if(ui.item.id=='') return false; $('#userId').val(ui.item.id); $('#fUserId').val(ui.item.id); }, search: function() { $('#userId').val(''); $('#fUserId').val(''); } }); // dialog delete $("#dialog-item-delete").dialog({ autoOpen: false, modal: true, title: '<?php echo osc_esc_js(__('Delete listing')); ?> ' }); // dialog bulk actions $("#dialog-bulk-actions").dialog({ autoOpen: false, modal: true }); $("#bulk-actions-submit").click(function() { $("#datatablesForm").submit(); }); $("#bulk-actions-cancel").click(function() { $("#datatablesForm").attr('data-dialog-open', 'false'); $('#dialog-bulk-actions').dialog('close'); }); // dialog bulk actions function $("#datatablesForm").submit(function() { if( $("#bulk_actions option:selected").val() == "" ) { return false; } if( $("#datatablesForm").attr('data-dialog-open') == "true" ) { return true; } $("#dialog-bulk-actions .form-row").html($("#bulk_actions option:selected").attr('data-dialog-content')); $("#bulk-actions-submit").html($("#bulk_actions option:selected").text()); $("#datatablesForm").attr('data-dialog-open', 'true'); $("#dialog-bulk-actions").dialog('open'); return false; }); // dialog filters $('#display-filters').dialog({ autoOpen: false, modal: true, width: 700, title: '<?php echo osc_esc_js(__('Filters')); ?> ' }); $('#btn-display-filters').click(function(){ $('#display-filters').dialog('open'); return false; }); // check_all bulkactions $("#check_all").change(function(){ var isChecked = $(this+':checked').length; $('.col-bulkactions input').each( function() { if( isChecked == 1 ) { this.checked = true; } else { this.checked = false; } }); }); }); // dialog delete function function delete_dialog(item_id) { $("#dialog-item-delete input[name='id[]']").attr('value', item_id); $("#dialog-item-delete").dialog('open'); return false; } </script> <?php }
?> </label> <div class="input"> <?php ItemForm::city_text(); ?> </div> </div> <div class="input-line"> <label><?php _e('Category'); ?> </label> <div class="input"> <?php ItemForm::category_select($categories, null, null, true); ?> </div> </div> <strong><?php _e('Status'); ?> </strong> <div class="input-line"> <label><?php _e('Premium'); ?> </label> <div class="input">
<dt><?php _e('Address'); ?> </dt> <dd><?php ItemForm::address_text($item); ?> </dd> </dl> </div> <?php if ($new_item) { ItemForm::plugin_post_item(); } else { ItemForm::plugin_edit_item(); } ?> <div class="clear"></div> <div align="center" style="margin-top: 30px; padding: 20px; background-color: #eee;"> <button type="button" onclick="window.location='<?php echo osc_admin_base_url(true); ?> ?page=items';" ><?php _e('Cancel'); ?> </button> <button type="submit"><?php if ($new_item) { _e('Add item'); } else {
function customHead() { ?> <script type="text/javascript"> document.write('<style type="text/css"> .tabber{ display:none; } </style>'); $(document).ready(function(){ $('input[name="user"]').attr( "autocomplete", "off" ); $('#user,#fUser').autocomplete({ source: "<?php echo osc_admin_base_url(true); ?> ?page=ajax&action=userajax", minLength: 0, select: function( event, ui ) { if(ui.item.id=='') { $("#contact_info").show(); return false; } $('#userId').val(ui.item.id); $('#fUserId').val(ui.item.id); $("#contact_info").hide(); } }); <?php if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') { ?> $("#price").blur(function(event) { var price = $("#price").attr("value"); <?php if (osc_locale_thousands_sep() != '') { ?> while(price.indexOf('<?php echo osc_esc_js(osc_locale_thousands_sep()); ?> ')!=-1) { price = price.replace('<?php echo osc_esc_js(osc_locale_thousands_sep()); ?> ', ''); } <?php } ?> <?php if (osc_locale_dec_point() != '') { ?> var tmp = price.split('<?php echo osc_esc_js(osc_locale_dec_point()); ?> '); if(tmp.length>2) { price = tmp[0]+'<?php echo osc_esc_js(osc_locale_dec_point()); ?> '+tmp[1]; } <?php } ?> $("#price").attr("value", price); }); <?php } ?> }); </script> <?php ItemForm::location_javascript_new('admin'); ?> <?php if (osc_images_enabled_at_items()) { ItemForm::photos_javascript(); } ?> <?php }
<div class="row"> <label for="contactName"><?php _e('Name', 'modern'); ?> </label> <?php ItemForm::contact_name_text(); ?> </div> <div class="row"> <label for="contactEmail"><?php _e('E-mail', 'modern'); ?> *</label> <?php ItemForm::contact_email_text(); ?> </div> </div> <?php } ?> <?php if (osc_recaptcha_items_enabled()) { ?> <div class="box"> <div class="row"> <?php osc_show_recaptcha(); ?>
</div> <div class="col-md-3"> <div class=" selector"> <?php osc_categories_select('sCategory', null, __('Select a category', 'pop')); ?> </div> </div> <div class="col-md-3"> <div class=" selector"> <?php $aCountries = osc_get_countries(); $aRegions = osc_get_regions($aCountries[0]['pk_c_code']); ?> <?php ItemForm::region_select($aRegions); ?> </div> </div> <div class="col-md-2"> <button class="btn btn-primary btn_search"> <?php _e("Search", 'pop'); ?> </button> </div> </div> <div id="message-seach"></div> </div> </form>
<h2>Home Slider</h2> <input type="checkbox" name="e_home_slider" value="1" <?php echo osc_get_preference('e_home_slider', 'classified') ? 'checked' : ''; ?> > <?php _e("Enable Home Slider.", 'classified'); ?> <div class="submit-data" id="submit-home-slider-data" type="button"> Submit</div> <div class="relative"> <div id="populate-slider"></div> </div> <table style="padding:20px;"> <tr> <td> <?php ItemForm::category_select(null, null, __('Select a category', 'classified')); ?> </td> <td> <select id="HomeSliderSelect" name="HomeSliderSelect"></select> </td> </tr> <tr> <td colspan="2" style="text-align:center" > <div class="submit-data" id="add-home-slider-item" type="button">Add New</div> </td> </tr> </table>
function customHead() { ?> <script type="text/javascript" src="<?php echo osc_current_admin_theme_js_url('jquery.validate.min.js'); ?> "></script> <script type="text/javascript"> document.write('<style type="text/css"> .tabber{ display:none; } </style>') ; $(document).ready(function(){ $("#userId").bind('change', function() { if($(this).val() == '') { $("#contact_info").show() ; } else { $("#contact_info").hide() ; } }) ; if( $("#userId").val() == '') { $("#contact_info").show() ; } else { $("#contact_info").hide() ; } <?php if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') { ?> $("#price").blur(function(event) { var price = $("#price").attr("value"); <?php if (osc_locale_thousands_sep() != '') { ?> while(price.indexOf('<?php echo osc_esc_js(osc_locale_thousands_sep()); ?> ')!=-1) { price = price.replace('<?php echo osc_esc_js(osc_locale_thousands_sep()); ?> ', ''); } <?php } ?> <?php if (osc_locale_dec_point() != '') { ?> var tmp = price.split('<?php echo osc_esc_js(osc_locale_dec_point()); ?> '); if(tmp.length>2) { price = tmp[0]+'<?php echo osc_esc_js(osc_locale_dec_point()); ?> '+tmp[1]; } <?php } ?> $("#price").attr("value", price); }); <?php } ?> }); </script> <?php ItemForm::location_javascript_new('admin'); ?> <?php if (osc_images_enabled_at_items()) { ItemForm::photos_javascript(); } ?> <?php }
public function save() { // check for request forgeries YRequest::checkToken() or jexit('Invalid Token'); // init vars $post = JRequest::get('post'); $db = YDatabase::getInstance(); $tzoffset = JFactory::getConfig()->getValue('config.offset'); $now = JFactory::getDate(); $now->setOffset($tzoffset); $msg = ''; try { $this->_init(); // is this an item edit? $edit = (int) $this->item->id; // is current user the item owner and does the user have sufficient user rights if ($edit && (!$this->item->canAccess($this->user) || $this->item->created_by != $this->user->id)) { throw new YControllerException('You are not allowed to make changes to this item.'); } // get default category - only in none trusted mode $categories = array(); if (!$this->submission->isInTrustedMode() && ($category = $this->submission->getForm($this->type->id)->get('category'))) { $categories[] = $category; } // get element data from post if (isset($post['elements'])) { // filter element data if (!$this->submission->isInTrustedMode() && !UserHelper::isJoomlaAdmin($this->user)) { JRequest::setVar('elements', SubmissionHelper::filterData($post['elements'])); $post = JRequest::get('post'); } // merge elements into post $post = array_merge($post, $post['elements']); } // fix publishing dates in trusted mode if ($this->submission->isInTrustedMode()) { // set publish up date if (isset($post['publish_up'])) { if (empty($post['publish_up'])) { $post['publish_up'] = $now->toMySQL(true); } } // set publish down date if (isset($post['publish_down'])) { if (trim($post['publish_down']) == JText::_('Never') || trim($post['publish_down']) == '') { $post['publish_down'] = $db->getNullDate(); } } } // sanatize tags if (!isset($post['tags'])) { $post['tags'] = array(); } // build new item form and bind it with post data $form = new ItemForm(array('submission' => $this->submission, 'item' => $this->item, 'elements_config' => $this->elements_config)); $form->bind($post); // save item if form is valid if ($form->isValid()) { // set name $this->item->name = $form->getValue('name'); // bind elements foreach ($this->elements_config as $data) { if (($element = $this->item->getElement($data->element)) && ($field = $form->getFormField($data->element))) { if ($field_data = $field->hasError() ? $field->getTaintedValue() : $field->getValue()) { $element->bindData($field_data); } else { $element->bindData(); } // perform submission uploads if ($element instanceof iSubmissionUpload) { $element->doUpload(); } } } // set alias $this->item->alias = ItemHelper::getUniqueAlias($this->item->id, YString::sluggify($this->item->name)); // set modified $this->item->modified = $now->toMySQL(); $this->item->modified_by = $this->user->get('id'); // creating new item if (!$edit) { // set state $this->item->state = 0; // set created date $this->item->created = $now->toMySQL(); $this->item->created_by = $this->user->get('id'); $this->item->created_by_alias = ''; // set publish up - publish down $this->item->publish_up = $now->toMySQL(); $this->item->publish_down = $db->getNullDate(); // set access $this->item->access = 0; // set searchable $this->item->searchable = 1; } if ($this->submission->isInTrustedMode()) { // set state $this->item->state = $form->getValue('state'); // set publish up if (($publish_up = $form->getValue('publish_up')) && !empty($publish_up)) { $date = JFactory::getDate($publish_up, $tzoffset); $publish_up = $date->toMySQL(); } $this->item->publish_up = $publish_up; // set publish down if (($publish_down = $form->getValue('publish_down')) && !empty($publish_down) && !($publish_down == $db->getNullDate())) { $date = JFactory::getDate($publish_down, $tzoffset); $publish_down = $date->toMySQL(); } $this->item->publish_down = $publish_down; // set searchable $this->item->searchable = $form->getValue('searchable'); // set comments enabled $this->item->params = $this->item->getParams()->set('config.enable_comments', $form->getValue('enable_comments'))->toString(); // set frontpage if ($form->getValue('frontpage')) { $categories[] = 0; } // set categories $tmp_categories = $form->getValue('categories'); if (!empty($tmp_categories)) { foreach ($form->getValue('categories') as $category) { $categories[] = $category; } } // set tags $tags = $form->hasError('tags') ? $form->getTaintedValue('tags') : $form->getValue('tags'); $this->item->setTags($tags); } else { // spam protection - user may only submit items every SubmissionController::TIME_BETWEEN_PUBLIC_SUBMISSIONS seconds if (!$edit) { $timestamp = $this->session->get('ZOO_LAST_SUBMISSION_TIMESTAMP'); $now = time(); if ($now < $timestamp + SubmissionController::TIME_BETWEEN_PUBLIC_SUBMISSIONS) { throw new SubmissionControllerException('You are submitting to fast, please try again in a few moments.'); } $this->session->set('ZOO_LAST_SUBMISSION_TIMESTAMP', $now); } } // save item YTable::getInstance('item')->save($this->item); // save category relations - only if editing in trusted mode if (!$edit || $this->submission->isInTrustedMode()) { CategoryHelper::saveCategoryItemRelations($this->item->id, $categories); } // set redirect message $msg = $this->submission->isInTrustedMode() ? JText::_('Thanks for your submission.') : JText::_('Thanks for your submission. It will be reviewed before being posted on the site.'); // add form to session if form is not valid } else { $this->addFormToSession($form); } } catch (SubmissionControllerException $e) { // raise warning on exception JError::raiseWarning(0, (string) $e); } catch (YException $e) { // raise warning on exception JError::raiseWarning(0, JText::_('There was an error saving your submission, please try again later.')); // add exception details, for super administrators only if ($this->user->superadmin) { JError::raiseWarning(0, (string) $e); } } // redirect to mysubmissions if ($this->redirect == 'mysubmissions' && $form && $form->isValid()) { $link = RouteHelper::getMySubmissionsRoute($this->submission); // redirect to edit form } else { $link = RouteHelper::getSubmissionRoute($this->submission, $this->type->id, $this->hash, $this->item_id, $this->redirect); } $link = JRoute::_($link, false); $this->setRedirect($link, $msg); }
function customHead() { ?> <script type="text/javascript"> document.write('<style type="text/css"> .tabber{ display:none; } </style>'); $(document).ready(function(){ $('input[name="user"]').attr( "autocomplete", "off" ); $('#user,#fUser').autocomplete({ source: "<?php echo osc_admin_base_url(true); ?> ?page=ajax&action=userajax", minLength: 0, select: function( event, ui ) { if(ui.item.id=='') { $("#contact_info").show(); return false; } $('#userId').val(ui.item.id); $('#fUserId').val(ui.item.id); $("#contact_info").hide(); } }); $('.ui-autocomplete').css('zIndex', 10000); <?php if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') { ?> $("#price").on("blur", function(event) { var price = $("#price").prop("value"); <?php if (osc_locale_thousands_sep() != '') { ?> while(price.indexOf('<?php echo osc_esc_js(osc_locale_thousands_sep()); ?> ')!=-1) { price = price.replace('<?php echo osc_esc_js(osc_locale_thousands_sep()); ?> ', ''); } <?php } ?> <?php if (osc_locale_dec_point() != '') { ?> var tmp = price.split('<?php echo osc_esc_js(osc_locale_dec_point()); ?> '); if(tmp.length>2) { price = tmp[0]+'<?php echo osc_esc_js(osc_locale_dec_point()); ?> '+tmp[1]; } <?php } ?> $("#price").prop("value", price); }); <?php } ?> $('#update_expiration').change( function() { if($(this).attr("checked")) { $('#dt_expiration').prop('value', ''); $('div.update_expiration').show(); } else { $('#dt_expiration').prop('value', '-1'); $('div.update_expiration').hide(); } }); $('body').on("created", '[name^="select_"]',function(evt) { selectUi($(this)); }); }); </script> <?php ItemForm::location_javascript('admin'); ?> <?php if (osc_images_enabled_at_items()) { ItemForm::photos_javascript(); } ?> <?php }
<?php ItemForm::show_email_checkbox(); ?> <label for="showEmail"><?php _e('Show e-mail on the listing page', 'bender'); ?> </label> </div> </div> </div> <?php } if ($edit) { ItemForm::plugin_edit_item(); } else { ItemForm::plugin_post_item(); } ?> <div class="control-group"> <?php if (osc_recaptcha_items_enabled()) { ?> <div class="controls"> <?php osc_show_recaptcha(); ?> </div> <?php } ?> <div class="controls">
echo osc_admin_base_url(true); ?> " class="has-form-actions hide"> <input type="hidden" name="page" value="plugins" /> <input type="hidden" name="action" value="renderplugin" /> <input type="hidden" name="route" value="payment-pro-admin-prices" /> <input type="hidden" name="plugin_action" value="add_category" /> <div class="form-horizontal"> <div class="form-row" id="select_row" > <div class="form-label"><?php _e('Category', 'payment_pro'); ?> </div> <div class="form-controls"> <?php ItemForm::category_select(); ?> </div> </div> <div class="form-row"> <div class="form-label"><?php _e('Publish price', 'payment_pro'); ?> </div> <div class="form-controls"><input type="text" id="publish_price" name="publish_price" value="" placeholder="<?php echo osc_get_preference('default_publish_cost', 'payment_pro'); ?> " /> <?php echo osc_get_preference('currency', 'payment_pro'); ?> </div>
public static function plugin_edit_item() { ItemForm::plugin_post_item('edit&itemId=' . osc_item_id()); }
} fieldset div.selector { width: 70px; } fieldset div.selector span{ width: 40px; } #uniform-select_range{ width: 70px; } #uniform-select_range span{ width: 40px; } </style> <?php ItemForm::location_javascript('admin'); ?> <script type="text/javascript"> $(function() { oTable = new osc_datatable(); oTable.fnInit({ 'idTable' : 'datatables_list', "sAjaxSource": "<?php echo osc_admin_base_url(true); ?> ?page=ajax&action=media&resourceId=<?php echo Params::getParam("id"); ?> ", 'iDisplayLength': '10', 'iColumns' : '5',