Ejemplo n.º 1
0
    function render()
    {
        global $FUNCS, $AUTH;
        $page_id = isset($_GET['p']) && $FUNCS->is_non_zero_natural($_GET['p']) ? (int) $_GET['p'] : null;
        $label = ' ';
        $desc = '';
        $visibility = $this->page->fields[10]->get_data() ? 'block' : 'none';
        //is_pointer
        $html .= '<div id="wrapper_k_pointer_link" style="display:' . $visibility . ';">';
        $html .= '<div class="group-wrapper_ex">';
        $html .= '<div class="group-toggler_ex">';
        $html .= '<b>' . $label . '</b>' . $desc;
        $html .= '</div>';
        $html .= '<div class="group-slider_ex">';
        $html .= parent::render();
        // Append 'masquerades' rado buttons too
        $visibility = strtolower($this->page->tpl_name) == 'index.php' ? 'block' : 'none';
        //No masquerading option for templates other than index.php (will always only redirect).
        $html .= '<div style="display:' . $visibility . ';">';
        $checked = !$this->page->fields[14]->get_data() ? 'checked="checked"' : '';
        $html .= '<input type="radio" ' . $checked . ' value="0" id="f_masquerades_0" name="f_masquerades" />';
        $html .= '<label for="f_masquerades_0">' . $FUNCS->t('redirects') . '</label>&nbsp;';
        $checked = $this->page->fields[14]->get_data() ? 'checked="checked"' : '';
        $html .= '<input type="radio" ' . $checked . ' value="1" id="f_masquerades_1" name="f_masquerades" />';
        $html .= '<label for="f_masquerades_1">' . $FUNCS->t('masquerades') . '</label>&nbsp;';
        $html .= '</div>';
        // ..and the 'strict check'
        $checked = !$this->page->fields[15]->get_data() ? 'checked="checked"' : '';
        $html .= '<div style="margin-top: 3px; margin-bottom: 8px;"><label><input type="checkbox" name="f_strict_matching" ' . $checked . ' value="1"/>' . $FUNCS->t('strict_matching') . '</label></div>';
        $html .= '</div></div>';
        ob_start();
        ?>
            <p>
                <?php 
        if ($this->page->effective_level <= $AUTH->user->access_level) {
            ?>
                <a class="button" id="btn_submit2" href="#" onclick="this.style.cursor='wait'; $('frm_edit_page').submit(); return false;"><span><?php 
            echo $FUNCS->t('save');
            ?>
</span></a>
                <?php 
        }
        ?>
                <?php 
        if ($_GET['act'] == 'edit') {
            $link = K_SITE_URL . $this->page->tpl_name;
            if (!is_null($page_id)) {
                $link .= '?p=' . $page_id;
            }
            echo '<a class="button" href="' . $link . '" target="_blank" onclick="this.blur();"><span>';
            if ($draft_of) {
                echo $FUNCS->t('preview');
            } else {
                echo $FUNCS->t('view');
            }
            echo '</span></a>';
        }
        ?>
            </p>
            <?php 
        $html .= ob_get_contents() . '</div>';
        ob_end_clean();
        return $html;
    }