Exemplo n.º 1
0
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 
}
Exemplo n.º 2
0
osc_add_hook('header', 'bender_nofollow_construct');
osc_enqueue_script('jquery-validate');
bender_add_body_class('item item-post');
$action = 'item_add_post';
$edit = false;
if (Params::getParam('action') == 'item_edit') {
    $action = 'item_edit_post';
    $edit = true;
}
osc_current_web_theme_path('header.php');
?>
        <?php 
if (bender_default_location_show_as() == 'dropdown') {
    ItemForm::location_javascript();
} else {
    ItemForm::location_javascript_new();
}
?>
    <div class="form-container form-horizontal">
        <div class="resp-wrapper">
            <div class="header">
                <h1><?php 
_e('Publish a listing', 'bender');
?>
</h1>
            </div>
            <ul id="error_list"></ul>
                <form name="item" action="<?php 
echo osc_base_url(true);
?>
" method="post" enctype="multipart/form-data" id="item-post">
Exemplo n.º 3
0
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 
}
Exemplo n.º 4
0
                    }
                    $('.items-filters').toggle() ;
                }) ;
            }) ;
        </script>
        <script type="text/javascript" src="<?php 
echo osc_current_admin_theme_js_url('datatables.post_init.js');
?>
"></script>
        <!-- /datatables js -->
        <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(){
                $('#user').attr( "autocomplete", "off" );
                $('#user').live('keyup.autocomplete', function(){
                    $('#userId').val('');
                    $( this ).autocomplete({
                        source: "<?php 
echo osc_admin_base_url(true);
?>
?page=ajax&action=userajax&term="+$('#user').val(),
                        minLength: 0,
                        select: function( event, ui ) {
                            if(ui.item.id=='') 
Exemplo n.º 5
0
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 
}
Exemplo n.º 6
0
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 
}