Example #1
0
function sb_core_deactivate_ajax_callback()
{
    echo SB_Message::get_deactivate_sb_core_confirm_text();
    die;
}
Example #2
0
    public static function rss_feed($args = array())
    {
        $id = isset($args['id']) ? $args['id'] : '';
        $name = isset($args['name']) ? $args['name'] : '';
        $list_feeds = isset($args['list_feeds']) ? $args['list_feeds'] : array();
        $description = isset($args['description']) ? $args['description'] : '';
        $order = isset($args['order']) ? $args['order'] : '';
        $count = SB_Option::get_theme_option(array('keys' => array('rss_feed', 'count')));
        if ($count > count($list_feeds)) {
            $count = count($list_feeds);
        }
        $real_count = $count;
        $next_id = 1;
        ?>
        <div id="<?php 
        echo esc_attr($id);
        ?>
" class="sb-addable rss-feed min-height relative gray-bg border padding-10 sb-ui-panel">
            <div class="item-group">
                <ul class="sb-sortable-list" data-message-confirm="<?php 
        echo SB_Message::get_confirm_delete_text();
        ?>
">
                    <?php 
        if (0 == $count) {
            $count++;
            SB_Admin_Custom::set_current_rss_feed_item(array('name' => $name, 'count' => $count));
            sb_core_get_loop('loop-rss-feed');
            $real_count = $count;
            $order = $count;
            $next_id++;
        }
        if (0 < $count) {
            $new_count = 1;
            foreach ($list_feeds as $feed) {
                $feed_id = isset($feed['id']) ? $feed['id'] : 0;
                if ($feed_id >= $next_id) {
                    $next_id = $feed_id + 1;
                    SB_Admin_Custom::set_current_rss_feed_item(array('feed' => $feed, 'count' => $new_count, 'name' => $name));
                    sb_core_get_loop('loop-rss-feed');
                    $new_count++;
                }
            }
        }
        ?>
                </ul>
                <input type="hidden" name="<?php 
        echo $name;
        ?>
[order]" value="<?php 
        echo $order;
        ?>
" class="ui-item-order item-order" autocomplete="off">
                <input type="hidden" name="<?php 
        echo $name;
        ?>
[count]" value="<?php 
        echo $real_count;
        ?>
" class="ui-item-count item-count" autocomplete="off">
            </div>
            <button class="button add-item ui-add-item absolute" data-type="rss_feed" data-name="<?php 
        echo $name;
        ?>
" data-count="<?php 
        echo $count;
        ?>
" data-next-id="<?php 
        echo $next_id;
        ?>
"><?php 
        _e('Add new', 'sb-core');
        ?>
</button>
            <button class="button reset-item ui-reset-item absolute reset" data-type="rss_feed"><?php 
        _e('Reset', 'sb-core');
        ?>
 <img src="<?php 
        echo SB_CORE_URL;
        ?>
/images/ajax-loader.gif"></button>
        </div>
        <?php 
        self::the_description($description);
    }