Jump to content

an unwanted button link shown on my custom Process module


adrianmak
 Share

Recommended Posts

I did write a custom process module, which is use for manage users

My code

<?php

class ProcessMember extends Process {

    public static function getModuleInfo() {

        return array(
            'title' => 'Manage Members',
            'version' => 1,
            'summary' => 'Manage member users.',
            'permission' => 'member-admin',
            'page' => array(
                'name' => 'member',
                'parent' => '',
                'title' => 'Member'
            )
        );
    }

    public function init() {
        parent::init();
    }

    public function execute() {

        $out = '';
        $selector = 'template=member-user|user, include=all, sort=name';

        $out .= "<div class='container'>";
        $out .= "<form action='./' method='post'>";
        $out .= "<div style='margin-bottom:10px;margin-top:10px;'><label for='keyword' style='width:100%;font-size:1.25em;'><i class='fa fa-search'></i><strong>Search</strong></label></div>";
        $out .= "<div><input class='ui-corner-all' style='width:100%;line-height:2em;font-size:1.5em;' type='text' name='keyword' id='search-box' placeholder='Search...' /></div>";
        $out .= "<button style='margin:10px 0;' class='ui-button ui-widget ui-corner-all head_button_clone ui-state-default' name='button' value='Add New' type='submit'><span class='ui-button-text'>Search</span></button>";
        $out .= "</form>";
        $out .= "</div>";

        if($this->input->post->keyword)
            $selector .= ",name|given_name|surname*=".$this->input->post->keyword;

        $members = $this->pages->find($selector);

        if(count($members)==0) {
            $out .= "No registered member.";
        } else {
            $user_role = "";
            $table = $this->modules->get("MarkupAdminDataTable");
            $table->headerRow(["", "NAME", "GIVEN NAME", "SURNAME", "E-MAIL ADDRESS", "ROLES", "TEMPLATE"]);
            $table->setEncodeEntities(false);

            foreach($members as $member) {

                //if($member->template=="member-user") {
                    if(!$member->approval && $member->template=="member-user")
                        $status = '<strong style="color:red; font-size:1.2em;">*</strong>';
                    else $status = "";
                //}

                foreach($member->roles as $role) {
                    $user_role .= $role->name.", ";
                }
                $user_role = rtrim($user_role,', ');
                $data = array(
                    $status,
                    $member->name=>$config->urls->admin."../access/users/edit/?id=".$member->id,
                    $member->given_name,
                    $member->surname,
                    $member->email,
                    $user_role,
                    $member->template,
                );
                $table->row($data);
                $user_role = "";
            }

            $out .= $table->render();

        }

        return $out;
    }
}

However I found that there is a button link, which is not come from my process module code
post-2272-0-61502700-1465257296_thumb.pn

Where does it come from? how could I remove it ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...