protected function actionListCountry()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $updated = $deleted = 0;

        foreach ($selected as $code) {

            if ($action === 'status' && $this->access('country_edit')) {
                $updated += (int) $this->country->update($code, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('country_delete')) {
                $deleted += (int) $this->country->delete($code);
            }
        }

        if ($updated > 0) {
            $message = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($message, 'success');
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
protected function actionListCountry()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $updated = $deleted = 0;

        foreach ($selected as $code) {

            if ($action === 'status' && $this->access('country_edit')) {
                $updated += (int) $this->country->update($code, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('country_delete')) {
                $deleted += (int) $this->country->delete($code);
            }
        }

        if ($updated > 0) {
            $message = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($message, 'success');
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
protected function actionListCountry ( ) { list ( $ selected , $ action , $ value ) = $ this -> getPostedAction ( ) ; $ updated = $ deleted = 0 ; foreach ( $ selected as $ code ) { if ( $ action === 'status' && $ this -> access ( 'country_edit' ) ) { $ updated += ( int ) $ this -> country -> update ( $ code , array ( 'status' => $ value ) ) ; } if ( $ action === 'delete' && $ this -> access ( 'country_delete' ) ) { $ deleted += ( int ) $ this -> country -> delete ( $ code ) ; } } if ( $ updated > 0 ) { $ message = $ this -> text ( 'Updated %num item(s)' , array ( '%num' => $ updated ) ) ; $ this -> setMessage ( $ message , 'success' ) ; } if ( $ deleted > 0 ) { $ message = $ this -> text ( 'Deleted %num item(s)' , array ( '%num' => $ deleted ) ) ; $ this -> setMessage ( $ message , 'success' ) ; } }
Applies an action to the selected countries
Applies an action to the selected countries