Get the HTML hidden field to print in your form to protect it

@param string $action The ajax action you are referring to

@return string The HTML code to print in your form
4162
public function generateNonceField($action)
    {
        $nonceName = $this->namespace . '_' . $action;

        return wp_nonce_field(md5($nonceName), $nonceName, true, false);
    }
312200
public function formElementId(string $action, string $var_name = ''): string
    {
        return $this->data_slug.'-'.$this->c::nameToSlug($action).($var_name ? '-'.$this->c::nameToSlug($var_name) : '');
    }
297476
public function getOnAction($action)
    {
        $action = trim($action);

        if (empty($action)) {
            return null;
        }

        return Helpers::postFixWith($action, ';');
    }
1268967
protected function renderHiddenActionUriQueryParameters()
    {
        $result = '';
        $actionUri = $this->getFormActionUri();
        $query = parse_url($actionUri, PHP_URL_QUERY);

        if (is_string($query)) {
            $queryParts = explode('&', $query);
            foreach ($queryParts as $queryPart) {
                if (strpos($queryPart, '=') !== false) {
                    list($parameterName, $parameterValue) = explode('=', $queryPart, 2);
                    $result .= chr(10) . '<input type="hidden" name="' . htmlspecialchars(urldecode($parameterName)) . '" value="' . htmlspecialchars(urldecode($parameterValue)) . '" />';
                }
            }
        }
        return $result;
    }
1160156
protected function formatAction($action)
    {
        if ($this->rootNamespace && ! (strpos($action, '\\') === 0)) {
            return $this->rootNamespace.'\\'.$action;
        } else {
            return trim($action, '\\');
        }
    }
1113937
private function convertToTbButtonConfig($action) {
		
		if (!isset($action['id'])) {
			throw new CException(Yii::t(
				'zii',
				'Each bulk action button should have its "id" attribute set to ensure its functionality among ajax updates'
			));
		}
		// button configuration is a regular TbButton
		$buttonConfig = array(
			'class' => 'booster.widgets.TbButton',
			'id' => $action['id'], // we must ensure this
			'buttonType' => isset($action['buttonType']) ? $action['buttonType'] : TbButton::BUTTON_LINK,
			'context' => isset($action['context']) ? $action['context'] : '',
			'size' => isset($action['size']) ? $action['size'] : TbButton::SIZE_SMALL,
			'icon' => isset($action['icon']) ? $action['icon'] : null,
			'label' => isset($action['label']) ? $action['label'] : null,
			'url' => isset($action['url']) ? $action['url'] : null,
			'active' => isset($action['active']) ? $action['active'] : false,
			'items' => isset($action['items']) ? $action['items'] : array(),
			'ajaxOptions' => isset($action['ajaxOptions']) ? $action['ajaxOptions'] : array(),
			'htmlOptions' => isset($action['htmlOptions']) ? $action['htmlOptions'] : array(),
			'encodeLabel' => isset($action['encodeLabel']) ? $action['encodeLabel'] : true,
			'click' => isset($action['click']) ? $action['click'] : false
		);
		return $buttonConfig;
	}
763011
private static String getActionString(int action) {

        switch (action) {

            case Constraint.RESTRICT :
                return Tokens.T_RESTRICT;

            case Constraint.CASCADE :
                return Tokens.T_CASCADE;

            case Constraint.SET_DEFAULT :
                return Tokens.T_SET + ' ' + Tokens.T_DEFAULT;

            case Constraint.SET_NULL :
                return Tokens.T_SET + ' ' + Tokens.T_NULL;

            default :
                return Tokens.T_NO + ' ' + Tokens.T_ACTION;
        }
    }
1364284
public function build($action = null)
	{
		$attributes = $this->get_config('form_attributes');
		if ($action and ($this->fieldset_tag == 'form' or empty($this->fieldset_tag)))
		{
			$attributes['action'] = $action;
		}

		$open = ($this->fieldset_tag == 'form' or empty($this->fieldset_tag))
			? $this->form()->open($attributes).PHP_EOL
			: $this->form()->{$this->fieldset_tag.'_open'}($attributes);

		$fields_output = '';

		// construct the tabular form table header
		if ($this->tabular_form_relation)
		{
			$properties = call_user_func($this->tabular_form_model.'::properties');
			$primary_keys = call_user_func($this->tabular_form_model.'::primary_key');
			$fields_output .= '<thead><tr>'.PHP_EOL;
			foreach ($properties as $field => $settings)
			{
				if ((isset($settings['skip']) and $settings['skip']) or in_array($field, $primary_keys))
				{
					continue;
				}
				if (isset($settings['form']['type']) and ($settings['form']['type'] === false or $settings['form']['type'] === 'hidden'))
				{
					continue;
				}
				$fields_output .= "\t".'<th class="'.$this->tabular_form_relation.'_col_'.$field.'">'.(isset($settings['label'])?\Lang::get($settings['label'], array(), $settings['label']):'').'</th>'.PHP_EOL;
			}
			$fields_output .= "\t".'<th>'.\Config::get('form.tabular_delete_label', 'Delete?').'</th>'.PHP_EOL;

			$fields_output .= '</tr></thead>'.PHP_EOL;
		}

		foreach ($this->field() as $f)
		{
			in_array($f->name, $this->disabled) or $fields_output .= $f->build().PHP_EOL;
		}

		$close = ($this->fieldset_tag == 'form' or empty($this->fieldset_tag))
			? $this->form()->close($attributes).PHP_EOL
			: $this->form()->{$this->fieldset_tag.'_close'}($attributes);

		$template = $this->form()->get_config((empty($this->fieldset_tag) ? 'form' : $this->fieldset_tag).'_template',
			"\n\t\t{open}\n\t\t<table>\n{fields}\n\t\t</table>\n\t\t{close}\n");

		$template = str_replace(array('{form_open}', '{open}', '{fields}', '{form_close}', '{close}'),
			array($open, $open, $fields_output, $close, $close),
			$template);

		return $template;
	}
862894
public function Link($action = null)
    {
        if ($this->reportObject) {
            return $this->reportObject->getLink($action);
        }

        // Basic link to this cms section
        return parent::Link($action);
    }
1071946
public function getActionResult($action = null)
    {
        $result = $this->results;

        if (!empty($action)) {
            $result = $this->results[$action];
        }

        return $result;
    }
1114771
protected function getIconClass($action) {
        if (in_array($action, ['add', 'remove', 'clone', 'drag-handle'])) {
            return $this->iconMap[$action];
        }

        if (YII_DEBUG) {
            throw new InvalidConfigException('Out of bounds, "' . $action . '" not found in your iconMap');
        }
        return '';
    }
412699
public function Link($action='') {
		if (strlen($this->ExternalURL) && !strlen($this->Content)) {
			// redirect away
			return $this->ExternalURL;
		}
		if ($this->InternalFile()->ID) {
			$file = $this->InternalFile();
			return $file->Link($action);
		}
		return parent::Link($action);
	}
291884
protected function formatAction($action)
    {
        if (is_array($action)) {
            $action = '\\'.implode('@', $action);
        }

        if ($this->rootNamespace && strpos($action, '\\') !== 0) {
            return $this->rootNamespace.'\\'.$action;
        } else {
            return trim($action, '\\');
        }
    }
588042
protected function _getEventName($action, $event = self::EVENT_NAME_BEFORE)
    {
        $details = [];
        if ($prefix = $this->_request->getParam('prefix')) {
            $details[] = ucfirst($prefix);
        }

        $details = Hash::merge($details, [
            'Controller',
            $this->_controller->getName(),
            $event . Inflector::camelize($action),
            'Process',
        ]);

        return implode('.', $details);
    }
213976
public function getPermission($action)
    {
        $action = strtoupper($action);
        if ($action == 'LIST') {
            return 'VIEW';
        } elseif ($action == 'SHOW') {
            return 'VIEW';
        } elseif ($action == 'NEW') {
            return 'CREATE';
        } elseif ($action == 'EDIT') {
            return 'EDIT';
        } elseif ($action == 'REMOVE') {
            return 'DELETE';
        }
        return $action;
    }
874043
public function generateHiddenFields()
    {
        $name = $this->generateFormName();
        $token = $this->generateToken($name);
        $html = '<input type="hidden" name="' . self::REQUEST_TOKEN_NAME . '" value="' . $name . '" />';
        $html .= '<input type="hidden" name="' . self::REQUEST_TOKEN_VALUE . '" value="' . $token . '" />';
        return $html;
    }
287438
public function notFound($action = null)
    {
        $methods = array("get", "post", "put", "delete", "ajax", "options", "head", "mobile");
        $route = new Route($methods, '*', $action, 'notFound');
        $this->container->addRoute($route);
        return $route;
    }