--------------------------------------------------------------------------//
489464
private void createArchiveTable()
	{
		archiveTable = new JTable(controller.getArchives());
		archiveTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

		archiveScrollPane = new JScrollPane(archiveTable);
		archiveScrollPane.setBounds(10, 10, 410, 210);

		this.add(archiveScrollPane);
	}
184465
public function set()
    {
        $args  = func_get_args();
        $count = func_num_args();

        if ( is_array($args[0]) )
        {
            foreach ($args[0] as $key => $value)
            {
                if ($key === 'path')
                {
                    $this->setPath($value);
                    continue;
                }

                if (property_exists($this, $key))
                {
                    $this->$key = $value;
                }
            }
        }
        elseif ($count === 2)
        {
            if ($args[0] === 'path')
            {
                $this->setPath($args[1]);
                return ;
            }

            if (property_exists($this, $args[0]))
            {
                $this[$args[0]] = $args[1];
            }
        }
    }
683787
public function initialize()
    {
        if ($this->all()->count() < 1) {
            return;
        }

        $this->all()->each(function (ActionInterface $action) {
            $action->initialize();
        });

        $this->setHtmlAttribute('data-type', 'display-actions');

        if (! $this->hasHtmlAttribute('class')) {
            $this->setHtmlAttribute('class', 'panel-footer');
        }
    }
342246
public function Bind()
	{
		if ( $this->getCount() > 0)
		{
			if ( $this->getAbstractNode(0) instanceof PathExprNode )
			{
				/**
				 * @var PathExprNode $pathExpr
				 */
				$pathExpr = $this->getAbstractNode(0);
				if ( in_array( $this->_name, FuncNode::$s_aggregates ) && $this->_ns == XmlReservedNs::xQueryFunc )
				{
					$pathExpr->Unordered = true;
				}
			}
		}
		parent::Bind();
	}
845733
public function indexAction()
    {
        $user = $this->userService->getCurrentUser();
        $workspacesArray = [];
        /** @var Workspace $workspace */
        foreach ($this->workspaceRepository->findAll() as $workspace) {

            // FIXME: This check should be implemented through a specialized Workspace Privilege or something similar
            if ($workspace->getOwner() !== null && $workspace->getOwner() !== $user) {
                continue;
            }

            $workspaceArray = [
                'name' => $workspace->getName(),
                'title' => $workspace->getTitle(),
                'description' => $workspace->getDescription(),
                'baseWorkspace' => $workspace->getBaseWorkspace()
            ];
            if ($user !== null) {
                $workspaceArray['readonly'] = !$this->userService->currentUserCanPublishToWorkspace($workspace);
            }
            $workspacesArray[] = $workspaceArray;
        }

        $this->view->assign('workspaces', $workspacesArray);
    }
184752
public function compile()
    {
        if (null !== $this->parameterBag) {
            $blocks = $this->getCoreBlocks();
            $blocks = array_merge($blocks, $this->getThirdPartyBlocks());
            foreach ($blocks as $block) {
                $this->prepareBlock($block);
            }
        }

        Config::read($this);

        parent::compile();
    }
970680
public function init()
    {
        if ($this->countRows < 1) {
            $this->totalPages = 0;
            $this->currentPage = 0;

            return;
        }

        if ($this->limit < 10) {
            $this->limit = 10;
        }

        $this->totalPages = (int)($this->countRows / $this->limit);

        if ($this->countRows % $this->limit) {
            $this->totalPages++;
        }

        if ($this->totalPages === 0) {
            $this->totalPages = 1;
        }

        if ($this->currentPage < 0) {
            $this->currentPage = 0;
        }

        if ($this->currentPage > $this->totalPages) {
            $this->currentPage = $this->totalPages;
        }
    }
580142
public function index() {
		$this->Prg->commonProcess();
        $conds = $this->Cliente->parseCriteria( $this->Prg->parsedParams() );
		$this->Cliente->recursive = 0;
                
        $descuentoMaximo = Configure::read('Mozo.descuento_maximo');
        $currentRole = $this->Session->read('Auth.User.role');
             
        
        if ( strtolower($currentRole) == 'mozo' && is_numeric( $descuentoMaximo ) ) {                
            $conds['OR'] = array(
                    "Descuento.porcentaje <= $descuentoMaximo",
                    'Descuento.porcentaje IS NULL'
                );
        }
        $this->Paginator->settings['conditions'] = $conds;
        
        $descuentos = $this->Cliente->Descuento->find('list');
		$tipoDocumentos = $this->Cliente->TipoDocumento->find('list');
		$ivaResponsabilidades = $this->Cliente->IvaResponsabilidad->find('list');
		$this->set(compact('descuentos', 'tipoDocumentos', 'ivaResponsabilidades'));
		$this->set('clientes', $this->Paginator->paginate());
		$this->set('_serialize', array('clientes'));
	}
1038254
public function supportAction()
    {
        $this->initHtml();

        $this->html->h3($this->_('Support'));
        $this->html->pInfo()->sprintf(
                $this->_('There is more than one way to get support for %s.'),
                $this->project->getName()
                );

        if ($url = $this->project->getDocumentationUrl()) {
            $this->html->h4($this->_('Documentation'));

            $this->html->pInfo()->sprintf($this->_('All available documentation is gathered at: %s'))
                    ->a($url, array('rel' => 'external', 'target' => 'documentation'));
        }

        if ($url = $this->project->getManualUrl()) {
            $this->html->h4($this->_('Manual'));

            $this->html->pInfo()->sprintf($this->_('The manual is available here: %s'))
                    ->a($url, array('rel' => 'external', 'target' => 'manual'));
        }

        if ($url = $this->project->getForumUrl()) {
            $this->html->h4($this->_('The forum'));

            $this->html->pInfo()->sprintf($this->_(
                    'You will find questions asked by other users and ask new questions at our forum site: %s'
                    ))->a($url, array('rel' => 'external', 'target' => 'forum'));
        }

        if ($url = $this->project->getSupportUrl()) {
            $this->html->h4($this->_('Support site'));

            $this->html->pInfo()->sprintf($this->_('Check our support site at %s.'))
                    ->a($url, array('rel' => 'external', 'target' => 'support'));
        }

        $this->html->h4($this->_('Or contact'));
        $this->html->append($this->_getOrganizationsList());
    }
449518
public function next()
    {
        $this->current = $this->parser->inner($this->start, $this->end);
        if ($this->current->isEmpty()) {
            $this->valid = false;
            $this->position = -1;
        } else {
            $this->valid = true;
            ++$this->position;
        }
    }
1351368
public function init()
    {
        return $this
            ->setEvents(array())
            ->setGroups(array())
            ->setModules(array())
            ->setNodeClass(null)
            ->setLogger(null)
            ->setWebSocketServer(null)
            ->setKernelEnvironment(null)
        ;
    }
84079
public function init()
    {
        parent::init();

        if (($this->module === null) || ($this->match === false)) {
            return;
        }

        $this->module->on(
            Module::EVENT_BEFORE_ACTION,
            function (ActionEvent $event) {
                $this->beforeAction($event);
            }
        );

        $this->module->on(
            Module::EVENT_AFTER_ACTION,
            function (ActionEvent $event) {
                $this->afterAction($event);
            }
        );

        $this->module->on(
            Module::EVENT_PROCESS_FILE,
            function ($event) {
                $this->onProcessFile($event);
            }
        );
    }
1203753
public function run()
        {
            $configs = $this->configs;
            $params = $this->params;
            foreach ($configs as $name => $value) {
                if ($value === '*') {
                    continue;
                }
                if (isset($params[$name])) {
                    $param = $params[$name];
                    if (is_array($value)) {
                        $check = $this->arrayValueChecker($param, $value);
                    } elseif (is_string($value)) {
                        $check = $this->stringValueChecker($param, $value);
                    }
                    if (false === $check) {
                        break;
                    }
                } else {
                    continue;
                }
            }
            if (false === $check) {
                $this->stopPageProcess();
            }
        }
912037
public function index() {
		$this->disableCache();
		$defaultConfig = $this->Setting->getDefaultConfig();
		$currentConfig = (array)$this->Setting->getConfig();
		$configUIlangs = $this->ConfigSettingsApp->getFlagConfigUiLangs();
		$configSMTP = $this->ConfigSettingsApp->getFlagConfigSmtp();
		$configAcLimit = $this->ConfigSettingsApp->getFlagConfigAcLimit();
		$configADsearch = $this->ConfigSettingsApp->getFlagConfigADsearch();
		$configExtAuth = $this->ConfigSettingsApp->getFlagConfigExtAuth();
		$authGroups = $this->ConfigSettingsApp->getAuthGroups();
		$groupList = $this->Ldap->getGroupList();
		$containerList = $this->Ldap->getTopLevelContainerList();
		$currLanguage = Hash::get($currentConfig, 'Setting.Language');
		$languages = $this->Setting->getUiLangsList();
		$schema = $this->Setting->getFullSchema();
		$passFields = [];
		foreach ($schema as $field => $metadata) {
			if (mb_stripos($field, 'password') !== false) {
				$passFields[] = $field;
			}
		}
		if ($this->request->is(['post', 'put'])) {
			foreach ($passFields as $passField) {
				if (mb_stripos($field, '_confirm') !== false) {
					continue;
				}

				$currPass = $this->request->data('Setting.' . $passField);
				$prevPpass = (string)Hash::get($currentConfig, 'Setting.' . $passField);
				if (empty($currPass) && !empty($prevPpass)) {
					$this->request->data('Setting.' . $passField, $prevPpass);
					$this->request->data('Setting.' . $passField . '_confirm', $prevPpass);
				}
			}
			$country = $this->request->data('Setting.Language');
			$language = $this->Setting->getLanguageByCountryCode($country);
			$this->request->data('Setting.Language', $language);
			if ($this->Setting->save($this->request->data)) {
				$this->Flash->success(__d('cake_settings_app', 'Application settings has been saved.'));
				if ($currLanguage !== $language) {
					$this->Flash->information(__d('cake_settings_app', 'Reload the page to apply the settings.'));
				}
				if (!$this->Session->read('Settings.FirstLogon')) {
					$this->ViewExtension->setProgressSseTask('ClearCache');
				}

				return $this->redirect(['action' => 'index']);
			} else {
				$this->Flash->error(__d('cake_settings_app', 'Unable to save application settings.'));
			}
		} else {
			$appSetting = Hash::merge(
				$defaultConfig,
				$currentConfig
			);
			$this->request->data('Setting', $appSetting['Setting']);
			$this->Setting->createValidationRules();
		}
		foreach ($passFields as $passField) {
			$this->request->data('Setting.' . $passField, '');
			$this->request->data('Setting.' . $passField . '_confirm', '');
		}

		$country = $this->Setting->getCountryCodeByLanguage($currLanguage);
		$this->request->data('Setting.Language', $country);
		$varsExt = $this->Setting->getVars();

		$pageHeader = __d('cake_settings_app', 'Application settings');
		$breadCrumbs = $this->Setting->getBreadcrumbInfo();
		$breadCrumbs[] = __d('cake_settings_app', 'Settings');

		$this->set(compact(
			'groupList',
			'containerList',
			'configUIlangs',
			'configSMTP',
			'configAcLimit',
			'configADsearch',
			'configExtAuth',
			'authGroups',
			'languages',
			'varsExt',
			'pageHeader',
			'breadCrumbs'
		));
	}
1070336
public function initialize()
    {
        $this->hasMany('id', UserPasswordChange::class, 'user_id', [
            'alias' => 'PasswordChanges',
            'foreignKey' => [
                'action' => Relation::ACTION_CASCADE,
            ],
        ]);

        $this->hasMany('id', UserPasswordReset::class, 'user_id', [
            'alias' => 'PasswordResets',
            'foreignKey' => [
                'action' => Relation::ACTION_CASCADE,
            ],
        ]);

        $this->hasMany('id', UserLoginHistory::class, 'user_id', [
            'alias' => 'LoginHistory',
            'foreignKey' => [
                'action' => Relation::ACTION_CASCADE,
            ],
        ]);

        $this->belongsTo("user_type_id", UserType::class, "id", [
            "alias" => "UserType",
            "foreignKey" => [
                "allowNulls" => true,
                "message" => "The user type specified is invalid!"
            ],
        ]);
    }
932181
public function current()
    {
        list($name, $content) = $this->members[$this->pointer];
        if (is_a($content, ViewHelperInterface::class)) {
            /** @var $content ViewHelperInterface */
            return $content->__toString();
        }
        switch ($name) {
            case 'charset':
                return "<meta {$name}=\"{$content}\">";
            case 'base':
                return "<base href=\"{$content}\" />";
            default:
                return "<meta name=\"{$name}\" content=\"{$content}\">";
        }
    }
1009352
public function manage()
    {
        $this->initLoop();

        /**
         * @var \ZMQContext
         */
        $this->context = new Context($this->loop);
        $this->initStreams();

        $this->pmReplySocket = $this->context->getSocket(\ZMQ::SOCKET_REP);

        $this->dtoContainer = new DtoContainer();
        $this->dtoContainer->setDto(new LmStateDto());
        $this->commandsManager = new CommandsManager();

        $this->declareGettingLmParams();

        $this->managingTimer();

        $this->loop->run();

        return null;
    }