Ejemplo n.º 1
0
    /**
     * Get content
     */
    public function getContent()
    {
        headline(t("rss.1"));
        echo t("rss.2") . '<div class="spacer"></div>';
        headline(t("rss.3"));
        $categories = user()->getCategories();
        $i = 1;
        foreach ($categories as $category) {
            $feeds = $category->feeds;
            ?>
            <div class="category" style="margin-bottom: 10px;">
                <div class="inner">
                    <div class="title" data-category="<?php 
            echo $category->getId();
            ?>
" data-feed="0">
                        <input type="checkbox" class="cat" checked="checked"/> <b><?php 
            echo s($category->name);
            ?>
</b>
                    </div>
                    <?php 
            if ($feeds) {
                foreach ($feeds as $feed) {
                    ?>
                            <div class="feed" data-category="<?php 
                    echo $category->getId();
                    ?>
" data-feed="<?php 
                    echo $feed->getId();
                    ?>
" style="margin-left: 10px; font-size: 12px;">
                                <input type="checkbox" class="feed" checked="checked" value="<?php 
                    echo $feed->getId();
                    ?>
"/> <?php 
                    echo s($feed->getCustomName($category));
                    ?>
                            </div>
                            <?php 
                }
            }
            ?>
                </div>
            </div>
            <?php 
        }
        $table = new Form_Table($this->getForm());
        $table->addButton(t("rss.9"), array("onclick" => "checkSubmit()"));
        echo $table->getHtml();
        ?>
        <script type="text/javascript">
        function checkSubmit(){
            var formtable = $("#form-rss").parent().data("formtable");
            if(formtable.validateAllFields()){
                var ids = [];
                $("input.feed:checked").each(function(){
                    ids.push(this.value);
                });
                window.open('<?php 
        echo url()->getModifiedUri(false);
        ?>
?f='+ids.join(",")+"&token=<?php 
        echo user()->getId() . "." . saltedHash("sha256", user()->getId());
        ?>
&title="+encodeURIComponent($("input[name='title']").val())+"&desc="+encodeURIComponent($("input[name='desc']").val())+"&max="+encodeURIComponent($("input[name='max']").val())+"&catmax="+encodeURIComponent($("input[name='catmax']").val())+"&feedmax="+encodeURIComponent($("input[name='feedmax']").val()));
            }

        }
        $("input.cat").on("click", function(){
            $(this).parent().parent().find("input.feed").prop("checked", this.checked);
        });
        </script>
        <?php 
    }
Ejemplo n.º 2
0
    /**
     * Get content
     */
    public function getContent()
    {
        headline(t("admin.user.1"));
        $users = RDR_User::getByCondition(null, null, "+username");
        foreach ($users as $user) {
            ?>
            <a href="<?php 
            echo url()->getModifiedUri(array("id" => $user->getId()));
            ?>
"><?php 
            echo s($user->username);
            ?>
 (<?php 
            echo t("user." . $user->role);
            ?>
)</a><br/>
            <?php 
        }
        ?>
        <div class="spacer"></div>
        <?php 
        headline($this->user->getId() ? t("admin.user.3") : t("admin.user.4"));
        $table = new Form_Table($this->form);
        $table->addSubmit(t("saveit"));
        if ($this->user->getId()) {
            $table->addButton(t("admin.user.4"), array("onclick" => "window.location.href = '" . url()->getModifiedUri(false) . "'"));
        }
        echo $table->getHtml();
    }