Executes the event cycle when running an AJAX handler.
@return boolean Returns true if the handler was found. Returns false otherwise.
500109
public function runAjaxHandler($handler)
    {
        /**
         * @event cms.component.beforeRunAjaxHandler
         * Provides an opportunity to modify an AJAX request to a component before it is processed by the component
         *
         * The parameter provided is `$handler` (the requested AJAX handler to be run)
         *
         * Example usage (forwards AJAX handlers to a backend widget):
         *
         *     Event::listen('cms.component.beforeRunAjaxHandler', function((\Cms\Classes\ComponentBase) $component, (string) $handler) {
         *         if (strpos($handler, '::')) {
         *             list($componentAlias, $handlerName) = explode('::', $handler);
         *             if ($componentAlias === $this->getBackendWidgetAlias()) {
         *                 return $this->backendControllerProxy->runAjaxHandler($handler);
         *             }
         *         }
         *     });
         *
         * Or
         *
         *     $this->controller->bindEvent('component.beforeRunAjaxHandler', function ((string) $handler) {
         *         if (strpos($handler, '::')) {
         *             list($componentAlias, $handlerName) = explode('::', $handler);
         *             if ($componentAlias === $this->getBackendWidgetAlias()) {
         *                 return $this->backendControllerProxy->runAjaxHandler($handler);
         *             }
         *         }
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.component.beforeRunAjaxHandler', [$handler])) {
            return $event;
        }

        $result = $this->$handler();

        /**
         * @event cms.component.runAjaxHandler
         * Provides an opportunity to modify an AJAX request to a component after it is processed by the component
         *
         * The parameters provided are `$handler` (the requested AJAX handler to be run) and `$result` (the result of the component processing the request)
         *
         * Example usage (Logs requests and their response):
         *
         *     Event::listen('cms.component.beforeRunHandler', function((\Cms\Classes\ComponentBase) $component, (string) $handler, (mixed) $result) {
         *         if (in_array($handler, $interceptHandlers)) {
         *             return 'request has been intercepted, original response: ' . json_encode($result);
         *         }
         *     });
         *
         * Or
         *
         *     $this->controller->bindEvent('componenet.beforeRunAjaxHandler', function ((string) $handler, (mixed) $result) {
         *         if (in_array($handler, $interceptHandlers)) {
         *             return 'request has been intercepted, original response: ' . json_encode($result);
         *         }
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.component.runAjaxHandler', [$handler, $result])) {
            return $event;
        }

        return $result;
    }
1105036
public function run()
    {
        $events = $this->events;
        $event  = $this->event;

        // Define callback used to determine whether or not to short-circuit
        $shortCircuit = function($r) use ($event) {
            if ($r instanceof ResponseInterface) {
                return true;
            }
            if ($event->getError()) {
                return true;
            }

            return false;
        };

        // Prepare route event
        $event->setName(MvcEvent::EVENT_ROUTE);
        $event->stopPropagation(false); // Clear before triggering

        // Trigger route event
        try {
            $result = $events->triggerEventUntil($shortCircuit, $event);
        } catch (Throwable $e) {
            return $this->handleException($e, $event, $events);
        } catch (Exception $e) {
            return $this->handleException($e, $event, $events);
        }

        if ($result->stopped()) {
            $response = $result->last();

            if ($response instanceof ResponseInterface) {
                return $this->completeResponse($events, $event, $response);
            }
        }

        if ($event->getError()) {
            return $this->completeRequest($event);
        }

        // Prepare dispatch event
        $event->setName(MvcEvent::EVENT_DISPATCH);
        $event->stopPropagation(false); // Clear before triggering

        // Trigger dispatch event
        $result = $events->triggerEventUntil($shortCircuit, $event);

        // Complete response
        $response = $result->last();

        if ($response instanceof ResponseInterface) {
            return $this->completeResponse($events, $event, $response);
        }

        $response = $this->response;

        $event->setResponse($response);

        return $this->completeRequest($event);
    }
432398
public function run()
    {
        $this->registerClientScript();
        $buttons = $this->createPageButtons();

        if (empty($buttons))
            return true;
        if ($this->centered) {
            echo \CHtml::openTag('div', array('class' => Enum::PAGINATION_CENTERED));
        }
        echo \CHtml::tag('ul', $this->htmlOptions, implode("\n", $buttons));
        if ($this->centered) {
            echo \CHtml::closeTag('div');
        }
    }
243713
public function run() {
		
		$id = $this->htmlOptions['id'];

		echo CHtml::closeTag('div'); //modal-content
        	echo CHtml::closeTag('div'); //modal-dialog
        	echo CHtml::closeTag('div'); //modal

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();

		$options = !empty($this->options) ? CJavaScript::encode($this->options) : '';
		$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').modal({$options});");

		foreach ($this->events as $name => $handler) {
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(__CLASS__ . '#' . $id . '_' . $name, "jQuery('#{$id}').on('{$name}', {$handler});");
		}
	}
133831
function() {
        if(this.active) {
            return false;
        }
        // register for event handlers defined on this class.
        var events = OpenLayers.Events.prototype.BROWSER_EVENTS;
        for (var i=0, len=events.length; i<len; i++) {
            if (this[events[i]]) {
                this.register(events[i], this[events[i]]); 
            }
        } 
        this.active = true;
        return true;
    }
627392
public function run()
	{
		if(isset($_GET[self::REFRESH_GET_VAR]))  // AJAX request for regenerating code
		{
			$code=$this->getVerifyCode(true);
			echo CJSON::encode(array(
				'hash1'=>$this->generateValidationHash($code),
				'hash2'=>$this->generateValidationHash(strtolower($code)),
				// we add a random 'v' parameter so that FireFox can refresh the image
				// when src attribute of image tag is changed
				'url'=>$this->getController()->createUrl($this->getId(),array('v' => uniqid())),
			));
		}
		else
			$this->renderImage($this->getVerifyCode());
		Yii::app()->end();
	}
393233
protected function handleRequest()
    {
        $this->call('received', array($this->input));
        
        if ($this->input->get('MsgType') && $this->input->get('MsgType') === 'event') {
            return $this->handleEvent($this->input);
        } elseif ($this->input->get('MsgId')) {
            return $this->handleMessage($this->input);
        }

        return false;
    }
234506
public function execute()
    {
        if (!$this->tryAndProcessRules()) {
            return false;
        }

        $phpmdBinaryPath = $this->phpci->findBinary('phpmd');

        $this->executePhpMd($phpmdBinaryPath);

        $errorCount = $this->processReport(trim($this->phpci->getLastOutput()));
        $this->build->storeMeta('phpmd-warnings', $errorCount);

        return $this->wasLastExecSuccessful($errorCount);
    }
1252516
public function run() {

		if( isset( $this->model ) ) {

			$modelContentService = Yii::$app->factory->get( 'modelContentService' );

			$content = $this->model->modelContent;

			if( $modelContentService->clearBanner( $content ) ) {

				// Trigger Ajax Success
				return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ) );
			}

			// Trigger Ajax Failure
			return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_REQUEST ) );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
702206
public function can_run() {
		// This handler can only run when we have an application defined
		if (class_exists('\\Skeleton\\Core\\Application') === false) {
			return false;
		}
		
		try {
			\Skeleton\Core\Application::get();
			return true;
		} catch (\Exception $e) {};

		return false;
	}
1364798
public function IsAjax () {
		if ($this->ajax === NULL) {
			$this->ajax = (
				isset($this->globalServer['HTTP_X_REQUESTED_WITH']) &&
				strlen($this->globalServer['HTTP_X_REQUESTED_WITH']) > 0
			);
		}
		return $this->ajax;
	}
841414
public function run() {

		$countryId = Yii::$app->request->post( 'country-id' );

		if( isset( $countryId ) && $countryId > 0 ) {

			$provinces = $this->modelService->getMapByCountryId( $countryId );

			// Trigger Ajax Success
			return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $provinces );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
1074750
public function eventCall()
    {
        try {
            //Daemon::log('cb - '.Debug::zdump($this->cb));
            $func = $this->cb;
            $func($this);
        } catch (\Exception $e) {
            Daemon::uncaughtExceptionHandler($e);
        }
    }
903781
public function exec(): void
    {
        if (Application::route()->isAjax()) {
            // if is ajax
            $this->handleExceptionInAjax($this->e);
        } else {
            // normal request
            $this->handleExceptionInNormalRequest($this->e);
        }
    }
940472
public function run()
    {
        if (!$this->overrideFile()) {
            $this->output->writeln("<info>File was skipped. The controller was not created.</info>");
            return true;
        }
        $data = $this->getControllerMetaData()->getData();
        $data = array_merge(
            $data,
            [
                'controllerName' => $this->controllerName,
                'namespace' => $this->namespace,
                'basePath' => $this->getBasePath()
            ]
        );
        $content = $this->getTemplateEngine()
            ->parse($this->template)
            ->process($data);
        file_put_contents($this->getControllerFile(), $content);
        return true;
    }
757453
public function run()
    {
        $event = $this->getMvcEvent();

        // Define callback used to determine whether or not to short-circuit
        $shortCircuit = function ($r) use ($event) {
            if ($r instanceof Response) {
                return true;
            }
            return false;
        };

        $events = $this->getEventManager();
        $result = $events->trigger(MvcEvent::EVENT_DISPATCH, $event, $shortCircuit);

        // Complete response
        $response = $result->last();
        if ($response instanceof Response) {
            $event->setTarget($this);
            $events->trigger(MvcEvent::EVENT_FINISH, $event);
        }

    }
745037
public function run()
    {
        // todo: think of a better way of doing this.
        $script = "jQuery('{$this->selector}').attr('data-spy', 'scroll');";
        if (isset($this->target)) {
            $script .= "jQuery('{$this->selector}').attr('data-target', '{$this->target}');";
        }
        if (isset($this->offset)) {
            $script .= "jQuery('{$this->selector}').attr('data-offset', '{$this->offset}');";
        }
        Yii::app()->clientScript->registerScript($this->getId(), $script, CClientScript::POS_BEGIN);
        $this->registerEvents($this->selector, $this->events);
    }