PodsUI::edit PHP Method

edit() public method

public edit ( boolean $duplicate = false ) : mixed
$duplicate boolean
return mixed
    public function edit($duplicate = false)
    {
        if (in_array('duplicate', $this->actions_disabled)) {
            $duplicate = false;
        }
        if (empty($this->row)) {
            $this->get_row();
        }
        if ($duplicate && false !== $this->callback_action('duplicate')) {
            return null;
        } elseif (false !== $this->callback_action('edit', $duplicate)) {
            return null;
        }
        ?>
    <div class="wrap pods-ui">
        <div id="icon-edit-pages" class="icon32"<?php 
        if (false !== $this->icon) {
            ?>
 style="background-position:0 0;background-size:100%;background-image:url(<?php 
            echo esc_url($this->icon);
            ?>
);"<?php 
        }
        ?>
><br /></div>
        <h2>
            <?php 
        echo $this->do_template($duplicate ? $this->header['duplicate'] : $this->header['edit']);
        if (!in_array('add', $this->actions_disabled) && !in_array('add', $this->actions_hidden)) {
            $link = pods_query_arg(array('action' . $this->num => 'add', 'id' . $this->num => '', 'do' . ($this->num = '')), self::$allowed, $this->exclusion());
            if (!empty($this->action_links['add'])) {
                $link = $this->action_links['add'];
            }
            ?>
                <a href="<?php 
            echo esc_url($link);
            ?>
" class="add-new-h2"><?php 
            echo $this->heading['add'];
            ?>
</a>
                <?php 
        } elseif (!in_array('manage', $this->actions_disabled) && !in_array('manage', $this->actions_hidden)) {
            $link = pods_query_arg(array('action' . $this->num => 'manage', 'id' . $this->num => ''), self::$allowed, $this->exclusion());
            if (!empty($this->action_links['manage'])) {
                $link = $this->action_links['manage'];
            }
            ?>
                <a href="<?php 
            echo esc_url($link);
            ?>
" class="add-new-h2">&laquo; <?php 
            echo sprintf(__('Back to %s', 'pods'), $this->heading['manage']);
            ?>
</a>
                <?php 
        }
        ?>
        </h2>

        <?php 
        $this->form(false, $duplicate);
        ?>
    </div>
    <?php 
    }