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


PHP osc_csrf_token_url函数代码示例

本文整理汇总了PHP中osc_csrf_token_url函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_csrf_token_url函数的具体用法?PHP osc_csrf_token_url怎么用?PHP osc_csrf_token_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: processData

 private function processData($pages)
 {
     if (!empty($pages)) {
         $prefLocale = osc_current_user_locale();
         foreach ($pages as $aRow) {
             $row = array();
             $content = array();
             if (isset($aRow['locale'][$prefLocale]) && !empty($aRow['locale'][$prefLocale]['s_title'])) {
                 $content = $aRow['locale'][$prefLocale];
             } else {
                 $content = current($aRow['locale']);
             }
             // -- options --
             $options = array();
             View::newInstance()->_exportVariableToView('page', $aRow);
             $options[] = '<a href="' . osc_static_page_url() . '" target="_blank">' . __('View page') . '</a>';
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=pages&amp;action=edit&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
             if (!$aRow['b_indelible']) {
                 $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=pages&amp;action=delete&amp;id=' . $aRow['pk_i_id'] . '&amp;' . osc_csrf_token_url() . '">' . __('Delete') . '</a>';
             }
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $row['bulkactions'] = '<input type="checkbox" name="id[]"" value="' . $aRow['pk_i_id'] . '"" />';
             $row['internal_name'] = $aRow['s_internal_name'] . $actions;
             $row['title'] = $content['s_title'];
             $row['order'] = '<div class="order-box">' . $aRow['i_order'] . ' <img class="up" onclick="order_up(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_up.png') . '" alt="' . __('Up') . '" title="' . __('Up') . '" />  <img class="down" onclick="order_down(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_down.png') . '" alt="' . __('Down') . '" title="' . __('Down') . '" /></div>';
             $row = osc_apply_filter('pages_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:35,代码来源:PagesDataTable.php

示例2: processData

 private function processData($users)
 {
     if (!empty($users)) {
         $csrf_token_url = osc_csrf_token_url();
         foreach ($users as $aRow) {
             $row = array();
             $options = array();
             $options_more = array();
             // first column
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=edit&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
             $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=users&action=delete&amp;id[]=' . $aRow['pk_i_id'] . '">' . __('Delete') . '</a>';
             $options[] = '<a href="' . osc_user_public_profile_url($aRow['pk_i_id']) . '" targe="_blank">' . __('Public profile') . '</a>';
             if ($aRow['b_active'] == 1) {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=deactivate&amp;id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '">' . __('Deactivate') . '</a>';
             } else {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=activate&amp;id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '">' . __('Activate') . '</a>';
             }
             if ($aRow['b_enabled'] == 1) {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=disable&amp;id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '">' . __('Block') . '</a>';
             } else {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=enable&amp;id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '">' . __('Unblock') . '</a>';
             }
             if (osc_user_validation_enabled() && $aRow['b_active'] == 0) {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=resend_activation&amp;id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '">' . __('Re-send activation email') . '</a>';
             }
             $options_more = osc_apply_filter('more_actions_manage_users', $options_more, $aRow);
             // more actions
             $moreOptions = '<li class="show-more">' . PHP_EOL . '<a href="#" class="show-more-trigger">' . __('Show more') . '...</a>' . PHP_EOL . '<ul>' . PHP_EOL;
             foreach ($options_more as $actual) {
                 $moreOptions .= '<li>' . $actual . "</li>" . PHP_EOL;
             }
             $moreOptions .= '</ul>' . PHP_EOL . '</li>' . PHP_EOL;
             $options = osc_apply_filter('actions_manage_users', $options, $aRow);
             // create list of actions
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $auxOptions .= $moreOptions;
             $auxOptions .= '</ul>' . PHP_EOL;
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $status = $this->get_row_status($aRow);
             $row['status-border'] = '';
             $row['status'] = $status['text'];
             $row['bulkactions'] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" /></div>';
             $row['email'] = '<a href="' . osc_admin_base_url(true) . '?page=items&userId=' . $aRow['pk_i_id'] . '&user=' . $aRow['s_name'] . '">' . $aRow['s_email'] . '</a>' . $actions;
             $row['username'] = $aRow['s_username'];
             $row['name'] = $aRow['s_name'];
             $row['date'] = osc_format_date($aRow['dt_reg_date']);
             $row['items'] = $aRow['i_items'];
             $row['update_date'] = osc_format_date($aRow['dt_mod_date']);
             $row = osc_apply_filter('users_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:57,代码来源:UsersDataTable.php

示例3: customHead

function customHead()
{
    $all = osc_get_preference('location_todo');
    if ($all == '') {
        $all = 0;
    }
    $worktodo = LocationsTmp::newInstance()->count();
    ?>
        <script type="text/javascript">
            function reload() {
                window.location = '<?php 
    echo osc_admin_base_url(true) . '?page=tools&action=locations';
    ?>
';
            }

            function ajax_() {
                $.ajax({
                    type: "POST",
                    url: '<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=location_stats&<?php 
    echo osc_csrf_token_url();
    ?>
',
                    dataType: 'json',
                    success: function(data) {
                        if(data.status=='done') {
                            $('span#percent').html(100);
                        }else{
                            var pending = data.pending;
                            var all = <?php 
    echo osc_esc_js($all);
    ?>
;
                            var percent = parseInt( ((all-pending)*100) / all );
                            $('span#percent').html(percent);
                            ajax_();
                        }
                    }
                });
            }

            $(document).ready(function(){
                if(<?php 
    echo $worktodo;
    ?>
> 0) {
                    ajax_();
                }
            });
        </script>
        <?php 
}
开发者ID:mylastof,项目名称:os-class,代码行数:55,代码来源:locations.php

示例4: add_market_jsvariables

    function add_market_jsvariables(){
        $marketPage = Params::getParam("mPage");
        $version_length = strlen(osc_version());
        $main_version = substr(osc_version(),0, $version_length-2).".".substr(osc_version(),$version_length-2, 1);


        if($marketPage>=1) $marketPage--;
        $action = Params::getParam("action");

        $js_lang = array(
                'by'                 => __('by'),
                'ok'                 => __('Ok'),
                'error_item'         => __('There was a problem, try again later please'),
                'wait_download'      => __('Please wait until the download is completed'),
                'downloading'        => __('Downloading'),
                'close'              => __('Close'),
                'download'           => __('Download'),
                'update'             => __('Update'),
                'last_update'        => __('Last update'),
                'downloads'          => __('Downloads'),
                'requieres_version'  => __('Requires at least'),
                'compatible_with'    => __('Compatible up to'),
                'screenshots'        => __('Screenshots'),
                'preview_theme'      => __('Preview theme'),
                'download_manually'  => __('Download manually'),
                'proceed_anyway'     => sprintf(__('Warning! This package is not compatible with your current version of Osclass (%s)'), $main_version),
                'sure'               => __('Are you sure?'),
                'proceed_anyway_btn' => __('Ok, proceed anyway'),
                'not_compatible'     => sprintf(__('Warning! This theme is not compatible with your current version of Osclass (%s)'), $main_version),
                'themes'             => array(
                                         'download_ok' => __('The theme has been downloaded correctly, proceed to activate or preview it.')
                                     ),
                'plugins'            => array(
                                         'download_ok' => __('The plugin has been downloaded correctly, proceed to install and configure.')
                                     ),
                'languages'          => array(
                                         'download_ok' => __('The language has been downloaded correctly, proceed to activate.')
                                     )

            );
        ?>
        <script type="text/javascript">
            var theme = window.theme || {};
            theme.adminBaseUrl  = "<?php echo osc_admin_base_url(true); ?>";
            theme.marketAjaxUrl = "<?php echo osc_admin_base_url(true); ?>?page=ajax&action=market&<?php echo osc_csrf_token_url(); ?>";
            theme.themUrl       = "<?php echo osc_current_admin_theme_url(); ?>";
            theme.langs         = <?php echo json_encode($js_lang); ?>;

            var osc_market = {};
            osc_market.main_version = <?php echo $main_version; ?>;
        </script>
        <?php
    }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:53,代码来源:header.php

示例5: processData

 private function processData($comments)
 {
     if (!empty($comments)) {
         $csrf_token_url = osc_csrf_token_url();
         foreach ($comments as $aRow) {
             $row = array();
             $options = array();
             $options_more = array();
             View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($aRow['fk_i_item_id']));
             if ($aRow['b_enabled']) {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=DISABLE">' . __('Block') . '</a>';
             } else {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=ENABLE">' . __('Unblock') . '</a>';
             }
             $options_more[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=comments&amp;action=delete&amp;id=' . $aRow['pk_i_id'] . '" id="dt_link_delete">' . __('Delete') . '</a>';
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=comment_edit&amp;id=' . $aRow['pk_i_id'] . '" id="dt_link_edit">' . __('Edit') . '</a>';
             if ($aRow['b_active']) {
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=INACTIVE">' . __('Deactivate') . '</a>';
             } else {
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=ACTIVE">' . __('Activate') . '</a>';
             }
             // more actions
             $moreOptions = '<li class="show-more">' . PHP_EOL . '<a href="#" class="show-more-trigger">' . __('Show more') . '...</a>' . PHP_EOL . '<ul>' . PHP_EOL;
             foreach ($options_more as $actual) {
                 $moreOptions .= '<li>' . $actual . "</li>" . PHP_EOL;
             }
             $moreOptions .= '</ul>' . PHP_EOL . '</li>' . PHP_EOL;
             // create list of actions
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $auxOptions .= $moreOptions;
             $auxOptions .= '</ul>' . PHP_EOL;
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $status = $this->get_row_status($aRow);
             $row['status-border'] = '';
             $row['status'] = $status['text'];
             $row['bulkactions'] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" />';
             if (empty($aRow['s_author_name'])) {
                 $user = User::newInstance()->findByPrimaryKey($aRow['fk_i_user_id']);
                 $aRow['s_author_name'] = $user['s_email'];
             }
             $row['author'] = $aRow['s_author_name'] . ' (<a target="_blank" href="' . osc_item_url() . '">' . osc_item_title() . '</a>)' . $actions;
             $row['comment'] = $aRow['s_body'];
             $row['date'] = osc_format_date($aRow['dt_pub_date']);
             $row = osc_apply_filter('comments_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:52,代码来源:CommentsDataTable.php

示例6: processData

 private function processData($alerts)
 {
     if (!empty($alerts) && !empty($alerts['alerts'])) {
         $csrf_token_url = osc_csrf_token_url();
         foreach ($alerts['alerts'] as $aRow) {
             $row = array();
             $options = array();
             // first column
             $row['bulkactions'] = '<input type="checkbox" name="alert_id[]" value="' . $aRow['pk_i_id'] . '" /></div>';
             $options[] = '<a onclick="return delete_alert(\'' . $aRow['pk_i_id'] . '\');" href="#">' . __('Delete') . '</a>';
             if ($aRow['b_active'] == 1) {
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=status_alerts&amp;alert_id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;status=0" >' . __('Deactivate') . '</a>';
             } else {
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=status_alerts&amp;alert_id[]=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;status=1" >' . __('Activate') . '</a>';
             }
             $options = osc_apply_filter('actions_manage_alerts', $options, $aRow);
             // create list of actions
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $auxOptions .= '</ul>' . PHP_EOL;
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             // second column
             $row['email'] = '<a href="' . osc_admin_base_url(true) . '?page=items&userId=">' . $aRow['s_email'] . '</a>' . $actions;
             // third row
             $pieces = array();
             $conditions = osc_get_raw_search((array) json_decode($aRow['s_search'], true));
             if (isset($conditions['sPattern']) && $conditions['sPattern'] != '') {
                 $pieces[] = sprintf(__("<b>Pattern:</b> %s"), $conditions['sPattern']);
             }
             if (isset($conditions['aCategories']) && !empty($conditions['aCategories'])) {
                 $l = min(count($conditions['aCategories']), 4);
                 $cat_array = array();
                 for ($c = 0; $c < $l; $c++) {
                     $cat_array[] = $conditions['aCategories'][$c];
                 }
                 if (count($conditions['aCategories']) > $l) {
                     $cat_array[] = '<a href="#" class="more-tooltip" categories="' . osc_esc_html(implode(", ", $conditions['aCategories'])) . '" >' . __("...More") . '</a>';
                 }
                 $pieces[] = sprintf(__("<b>Categories:</b> %s"), implode(", ", $cat_array));
             }
             $row['alert'] = implode($pieces, ", ");
             // fourth row
             $row['date'] = osc_format_date($aRow['dt_date']);
             $row = osc_apply_filter('alerts_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:51,代码来源:AlertsDataTable.php

示例7: processData

 private function processData($rules)
 {
     if (!empty($rules)) {
         $csrf_token_url = osc_csrf_token_url();
         foreach ($rules as $aRow) {
             $row = array();
             $options = array();
             $options_more = array();
             // first column
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=edit_ban_rule&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
             $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=users&action=delete_ban_rule&amp;id[]=' . $aRow['pk_i_id'] . '">' . __('Delete') . '</a>';
             $options_more = osc_apply_filter('more_actions_manage_rules', $options_more, $aRow);
             // more actions
             $moreOptions = '<li class="show-more">' . PHP_EOL . '<a href="#" class="show-more-trigger">' . __('Show more') . '...</a>' . PHP_EOL . '<ul>' . PHP_EOL;
             foreach ($options_more as $actual) {
                 $moreOptions .= '<li>' . $actual . "</li>" . PHP_EOL;
             }
             $moreOptions .= '</ul>' . PHP_EOL . '</li>' . PHP_EOL;
             $options = osc_apply_filter('actions_manage_rules', $options, $aRow);
             // create list of actions
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $auxOptions .= $moreOptions;
             $auxOptions .= '</ul>' . PHP_EOL;
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $row['bulkactions'] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" /></div>';
             $row['name'] = $aRow['s_name'] . $actions;
             $row['ip'] = $aRow['s_ip'];
             $row['email'] = $aRow['s_email'];
             $row = osc_apply_filter('rules_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:37,代码来源:BanRulesDataTable.php

示例8: customPageHeader


//.........这里部分代码省略.........
                $("#dialog-connect").dialog({
                    width: '480',
                    autoOpen: false,
                    modal: true
                });
                $("#connect-submit").on('click', function() {
                    $('#connect_form').hide();
                    $('#connect_wait').show();
                    $.getJSON(
                        '<?php 
        echo osc_admin_base_url(true);
        ?>
?page=ajax&action=market_connect',
                        {'s_email' : $('#connect_user').attr('value'), 's_password' : $('#connect_password').attr('value')},
                        function(data){
                            if(data==null) {
                                $('#connect_form').show();
                                $('#connect_wait').hide();
                                var data = new Object();
                                data.error = 1;
                                data.msg = '<?php 
        _e('Sorry, the market is currently unavailable. Please try again in a few moments.');
        ?>
';
                            }
                            if(data.error==1) {
                                $('#connect_form').show();
                                $('#connect_wait').hide();
                                alert(data.msg);
                                var flash = $("#flash_js");
                                var message = $('<div>').addClass('pubMessages').addClass(class_type).attr('id', 'flashmessage').html(data.msg);
                                flash.html(message);
                                $("#flashmessage").slideDown('slow').delay(3000).slideUp('slow');
                            } else {
                                window.location.reload(true);
                            }
                        }
                    );
                });

                $("#connect-cancel").on('click', function() {
                    $('#dialog-connect').dialog('close');
                });

                $("#market_connect").on('click', function() {
                    $('#dialog-connect').dialog('open');
                });

                <?php 
    }
    ?>

                $('#market_categories').bind("change", function() {
                    <?php 
    if (Params::getParam('action') != '') {
        ?>
                        window.location = theme.marketCurrentURL + '&sCategory=' + $("#market_categories option:selected").prop('value');
                    <?php 
    } else {
        ?>
                        window.location = theme.marketCurrentURL + $("#market_categories option:selected").attr('section-data') + '&sCategory=' + $("#market_categories option:selected").prop('value');
                    <?php 
    }
    ?>
                });

                $("#market_disconnect").on('click', function() {
                    var x = confirm('<?php 
    _e('You are going to be disconnected from the Market, all your plugins and themes downloaded will remain installed and configured but you will not be able to update or download new plugins and themes. Are you sure?');
    ?>
');
                    if(x) {
                        window.location = '<?php 
    echo osc_admin_base_url(true);
    ?>
?page=settings&action=market_disconnect&<?php 
    echo osc_csrf_token_url();
    ?>
&redirect=<?php 
    echo base64_encode(osc_admin_base_url(true) . '?page=market&action=' . Params::getParam('action'));
    ?>
';
                    }
                })

                $.getJSON(
                    '<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=market_header',
                    function(data){
                        if(data.error==1) {
                        } else {
                            $('#content-head div.banner-market').html(data.html);
                        }
                    });
            });
        </script>
<?php 
}
开发者ID:naneri,项目名称:Osclass,代码行数:101,代码来源:header.php

示例9: _e

                        </div>
                    </div>
                </div>
                <h2 class="render-title"><?php 
_e('Regenerate images');
?>
</h2>
                <div class="form-row">
                    <div class="form-controls">
                    <p>
                        <?php 
_e("You can regenerate different image dimensions. If you have changed the dimension of thumbnails, preview or normal images, you might want to regenerate your images.");
?>
                    </p>
                    <a class="btn" href="<?php 
echo osc_admin_base_url(true) . '?page=settings&action=images_post' . '&' . osc_csrf_token_url();
?>
"><?php 
_e('Regenerate');
?>
</a>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="form-actions">
                    <input type="submit" id="save_changes" value="<?php 
echo osc_esc_html(__('Save changes'));
?>
" class="btn btn-submit" />
                </div>
            </div>
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:media.php

示例10: doModel


//.........这里部分代码省略.........
                 osc_add_flash_error_message(_m('An error has occurred'), 'admin');
             }
             $this->redirectTo($_SERVER['HTTP_REFERER']);
             break;
         case 'clear_stat':
             osc_csrf_check();
             $id = Params::getParam('id');
             $stat = Params::getParam('stat');
             if (!$id) {
                 return false;
             }
             if (!$stat) {
                 return false;
             }
             $id = (int) $id;
             if (!is_numeric($id)) {
                 return false;
             }
             $success = $this->itemManager->clearStat($id, $stat);
             if ($success) {
                 osc_add_flash_ok_message(_m('The listing has been unmarked as') . " {$stat}", 'admin');
             } else {
                 osc_add_flash_error_message(_m("The listing hasn't been unmarked as") . " {$stat}", 'admin');
             }
             $this->redirectTo($_SERVER['HTTP_REFERER']);
             break;
         case 'item_edit':
             // edit item
             $id = Params::getParam('id');
             $item = Item::newInstance()->findByPrimaryKey($id);
             if (count($item) <= 0) {
                 $this->redirectTo(osc_admin_base_url(true) . "?page=items");
             }
             $csrf_token = osc_csrf_token_url();
             if ($item['b_active']) {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=INACTIVE">' . __('Deactivate') . '</a>';
             } else {
                 $actions[] = '<a class="btn btn-red float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=ACTIVE">' . __('Activate') . '</a>';
             }
             if ($item['b_enabled']) {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=DISABLE">' . __('Block') . '</a>';
             } else {
                 $actions[] = '<a class="btn btn-red float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=ENABLE">' . __('Unblock') . '</a>';
             }
             if ($item['b_premium']) {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status_premium&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=0">' . __('Unmark as premium') . '</a>';
             } else {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status_premium&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=1">' . __('Mark as premium') . '</a>';
             }
             if ($item['b_spam']) {
                 $actions[] = '<a class="btn btn-red float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status_spam&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=0">' . __('Unmark as spam') . '</a>';
             } else {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=items&amp;action=status_spam&amp;id=' . $item['pk_i_id'] . '&amp;' . $csrf_token . '&amp;value=1">' . __('Mark as spam') . '</a>';
             }
             $this->_exportVariableToView("actions", $actions);
             $form = count(Session::newInstance()->_getForm());
             $keepForm = count(Session::newInstance()->_getKeepForm());
             if ($form == 0 || $form == $keepForm) {
                 Session::newInstance()->_dropKeepForm();
             }
             // save referer if belongs to manage items
             // redirect only if ManageItems or ReportedListngs
             if (isset($_SERVER['HTTP_REFERER'])) {
                 $referer = $_SERVER['HTTP_REFERER'];
                 if (preg_match('/page=items/', $referer)) {
                     if (preg_match("/action=([\\p{L}|_|-]+)/u", $referer, $matches)) {
开发者ID:jmcclenon,项目名称:Osclass,代码行数:67,代码来源:items.php

示例11: osc_delete_comment_url

/**
 * Gets  link to delete the current comment of current item
 *
 * @return string
 */
function osc_delete_comment_url()
{
    return (string) osc_base_url(true) . "?page=item&action=delete_comment&id=" . osc_item_id() . "&comment=" . osc_comment_id() . "&" . osc_csrf_token_url();
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:9,代码来源:hItems.php

示例12: doModel

 function doModel()
 {
     parent::doModel();
     //specific things for this class
     switch ($this->action) {
         case 'create':
             // calling create view
             $aRegions = array();
             $aCities = array();
             $aCountries = Country::newInstance()->listAll();
             if (isset($aCountries[0]['pk_c_code'])) {
                 $aRegions = Region::newInstance()->findByCountry($aCountries[0]['pk_c_code']);
             }
             if (isset($aRegions[0]['pk_i_id'])) {
                 $aCities = City::newInstance()->findByRegion($aRegions[0]['pk_i_id']);
             }
             $this->_exportVariableToView('user', null);
             $this->_exportVariableToView('countries', $aCountries);
             $this->_exportVariableToView('regions', $aRegions);
             $this->_exportVariableToView('cities', $aCities);
             $this->_exportVariableToView('locales', OSCLocale::newInstance()->listAllEnabled());
             $this->doView("users/frm.php");
             break;
         case 'create_post':
             // creating the user...
             osc_csrf_check();
             require_once LIB_PATH . 'osclass/UserActions.php';
             $userActions = new UserActions(true);
             $success = $userActions->add();
             switch ($success) {
                 case 1:
                     osc_add_flash_ok_message(_m("The user has been created. We've sent an activation e-mail"), 'admin');
                     break;
                 case 2:
                     osc_add_flash_ok_message(_m('The user has been created successfully'), 'admin');
                     break;
                 default:
                     osc_add_flash_error_message($success, 'admin');
                     break;
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=users');
             break;
         case 'edit':
             // calling the edit view
             $aUser = $this->userManager->findByPrimaryKey(Params::getParam("id"));
             $aCountries = Country::newInstance()->listAll();
             $aRegions = array();
             if ($aUser['fk_c_country_code'] != '') {
                 $aRegions = Region::newInstance()->findByCountry($aUser['fk_c_country_code']);
             } else {
                 if (count($aCountries) > 0) {
                     $aRegions = Region::newInstance()->findByCountry($aCountries[0]['pk_c_code']);
                 }
             }
             $aCities = array();
             if ($aUser['fk_i_region_id'] != '') {
                 $aCities = City::newInstance()->findByRegion($aUser['fk_i_region_id']);
             } else {
                 if (count($aRegions) > 0) {
                     $aCities = City::newInstance()->findByRegion($aRegions[0]['pk_i_id']);
                 }
             }
             $csrf_token = osc_csrf_token_url();
             if ($aUser['b_active']) {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=users&action=deactivate&id[]=' . $aUser['pk_i_id'] . '&' . $csrf_token . '&value=INACTIVE">' . __('Deactivate') . '</a>';
             } else {
                 $actions[] = '<a class="btn btn-red float-left" href="' . osc_admin_base_url(true) . '?page=users&action=activate&id[]=' . $aUser['pk_i_id'] . '&' . $csrf_token . '&value=ACTIVE">' . __('Activate') . '</a>';
             }
             if ($aUser['b_enabled']) {
                 $actions[] = '<a class="btn float-left" href="' . osc_admin_base_url(true) . '?page=users&action=disable&id[]=' . $aUser['pk_i_id'] . '&' . $csrf_token . '&value=DISABLE">' . __('Block') . '</a>';
             } else {
                 $actions[] = '<a class="btn btn-red float-left" href="' . osc_admin_base_url(true) . '?page=users&action=enable&id[]=' . $aUser['pk_i_id'] . '&' . $csrf_token . '&value=ENABLE">' . __('Unblock') . '</a>';
             }
             $this->_exportVariableToView("actions", $actions);
             $this->_exportVariableToView("user", $aUser);
             $this->_exportVariableToView("countries", $aCountries);
             $this->_exportVariableToView("regions", $aRegions);
             $this->_exportVariableToView("cities", $aCities);
             $this->_exportVariableToView("locales", OSCLocale::newInstance()->listAllEnabled());
             $this->doView("users/frm.php");
             break;
         case 'edit_post':
             // edit post
             osc_csrf_check();
             require_once LIB_PATH . 'osclass/UserActions.php';
             $userActions = new UserActions(true);
             $success = $userActions->edit(Params::getParam("id"));
             if ($success == 1) {
                 osc_add_flash_ok_message(_m('The user has been updated'), 'admin');
             } else {
                 if ($success == 2) {
                     osc_add_flash_ok_message(_m('The user has been updated and activated'), 'admin');
                 } else {
                     osc_add_flash_error_message($success);
                     $this->redirectTo(osc_admin_base_url(true) . '?page=users&action=edit&id=' . Params::getParam('id'));
                 }
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=users');
             break;
         case 'resend_activation':
//.........这里部分代码省略.........
开发者ID:naneri,项目名称:Osclass,代码行数:101,代码来源:users.php

示例13: _e

                            <div class="form-horizontal">
                            <div class="form-row">
                                <?php 
_e("While in maintenance mode, users can't access your website. Useful if you need to make changes on your website. Use the following button to toggle maintenance mode ON/OFF.");
?>
                                <div class="help-box">
                                    <?php 
printf(__('Maintenance mode is: <strong>%s</strong>'), $maintenance ? __('ON') : __('OFF'));
?>
                                </div>
                            </div>
                            <div class="form-actions">
                                <input type="button" value="<?php 
echo $maintenance ? osc_esc_html(__('Disable maintenance mode')) : osc_esc_html(__('Enable maintenance mode'));
?>
" onclick="window.location.href='<?php 
echo osc_admin_base_url(true);
?>
?page=tools&amp;action=maintenance&amp;mode=<?php 
echo ($maintenance ? 'off' : 'on') . "&amp;" . osc_csrf_token_url();
?>
';" class="btn btn-submit" />
                            </div>
                        </div>
                        </fieldset>
                    </form>
                </div>
                <!-- /settings form -->
</div>
<?php 
osc_current_admin_theme_path('parts/footer.php');
开发者ID:jmcclenon,项目名称:Osclass,代码行数:31,代码来源:maintenance.php

示例14: function

        $("#market_install").on("click", function(){
            $(".ui-dialog-content").dialog("close");
            $('<div id="downloading"><div class="osc-modal-content"><?php 
echo osc_esc_js(__('Please wait until the download is completed'));
?>
</div></div>').dialog({title:'<?php 
echo osc_esc_js(__('Downloading'));
?>
...',modal:true});
            $.getJSON(
            "<?php 
echo osc_admin_base_url(true);
?>
?page=ajax&action=market&<?php 
echo osc_csrf_token_url();
?>
",
            {"code" : $("#market_code").attr("value"), "section" : 'themes'},
            function(data){
                var content = data.message;
                if(data.error == 0) { // no errors
                    content += '<h3><?php 
echo osc_esc_js(__('The theme has been downloaded correctly, proceed to activate or preview it.'));
?>
</h3>';
                    content += "<p>";
                    content += '<a class="btn btn-mini btn-green" href="<?php 
echo osc_admin_base_url(true);
?>
?page=appearance&marketError='+data.error+'&slug='+data.data['s_update_url']+'"><?php 
开发者ID:mylastof,项目名称:os-class,代码行数:30,代码来源:index.php

示例15: customHead

function customHead()
{
    $csrf_token = osc_csrf_token_url();
    ?>
<script type="text/javascript">
    function show_iframe(class_name, id) {
        if($('.content_list_'+id+' .custom-field-frame').length == 0){
            $('.custom-field-frame').remove();
            var name = 'frame_'+ id;
            var id_  = 'frame_'+ id;
            var url  = '<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=field_categories_iframe&<?php 
    echo $csrf_token;
    ?>
&id=' + id;
            $.ajax({
                url: url,
                context: document.body,
                success: function(res){
                    $('div.'+class_name).html(res);
                    $('div.'+class_name).fadeIn("fast");
                }
            });
        } else {
            $('.custom-field-frame').remove();
        }
        return false;
    }

    function delete_field(id) {
        $("#dialog-delete-field").attr('data-field-id', id);
        $("#dialog-delete-field").dialog('open');
        return false;
    }

     // check all the categories
    function checkAll(id, check) {
        aa = $('#' + id + ' input[type=checkbox]').each(function() {
            $(this).attr('checked', check);
        });
    }
    function checkCat(id, check) {
        aa = $('#cat' + id + ' input[type=checkbox]').each(function() {
            $(this).attr('checked', check);
        });
    }

    $(document).ready(function() {
        $('.cfield-div').live('mouseenter',function(){
            $(this).addClass('cfield-hover');
        }).live('mouseleave',function(){
            $(this).removeClass('cfield-hover');
        });

        // dialog delete
        $("#dialog-delete-field").dialog({
            autoOpen: false,
            modal: true
        });
        $("#field-delete-submit").click(function() {
            var id  = $("#dialog-delete-field").attr('data-field-id');
            var url = '<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=delete_field&<?php 
    echo $csrf_token;
    ?>
&id=' + id;
            $.ajax({
                url: url,
                context: document.body,
                success: function(res){
                    var ret = eval( "(" + res + ")");
                    var message = "";
                    if(ret.error) {
                        message += ret.error;
                    }
                    if(ret.ok){
                        message += ret.ok;

                        $('#list_'+id).fadeOut("slow");
                        $('#list_'+id).remove();
                    }

                    $(".jsMessage").css('display', 'block');
                    $(".jsMessage p").html(message);
                },
                error: function(){
                    $(".jsMessage").css('display', 'block');
                    $(".jsMessage p").html('<?php 
    echo osc_esc_js(__("Ajax error, try again."));
    ?>
');
                }
            });
            $('#dialog-delete-field').dialog('close');
            return false;
        });
//.........这里部分代码省略.........
开发者ID:jmcclenon,项目名称:Osclass,代码行数:101,代码来源:index.php


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