Konfiguracja dla trybu Advanced
487641
protected function _modeAdvanced()
    {
        if ($this->getToolbars() === null) {
            $this->setToolbars([
                'undo redo | cut copy paste pastetext | searchreplace | bold italic underline strikethrough | subscript superscript | alignleft aligncenter alignright alignjustify | fontselect fontsizeselect | forecolor backcolor',
                'styleselect | table | bullist numlist outdent indent blockquote | link unlink anchor | image media lioniteimages | preview fullscreen code | charmap visualchars nonbreaking inserttime hr'
            ]);
        }
        if ($this->getContextMenu() === null) {
            $this->setContextMenu('link image media inserttable | cell row column deletetable');
        }
    }
856070
protected function _bufferingAllowed()
    {
        //jeśli zdefiniowano własny obiekt sprawdzający, czy można buforować
        if (\App\Registry::$config->category instanceof \Cms\Config\CategoryConfig && \App\Registry::$config->category->bufferingAllowedClass) {
            $class = \App\Registry::$config->category->bufferingAllowedClass;
            $buffering = new $class($this->_request);
        } else {
            //domyślny cmsowy obiekt sprawdzający, czy można buforować
            $buffering = new \Cms\Model\CategoryBuffering($this->_request);
        }
        return $buffering->isAllowed();
    }
37721
protected function installDone()
    {
        $this->nl();
        if ($this->seemsFine) {
            $this->output->writeLn("========================================================================");
            $this->nl();
            $this->output->writeLn("                      Repair completed!");
            $this->nl();
            $this->output->writeLn("========================================================================");
        } else {
            $this->output->writeLn("Automatic installation failed to complete cleanly.");
            $this->output->writeLn("Head over to https://github.com/strata-mvc/strata/ to get help.");
        }
        $this->nl();
    }
465222
function setup() {
        var tmp = get('skin')
        if (tmp && $.inArray(tmp, mySkins))
            changeSkin(tmp)

        // Add the change skin listener
        $('[data-skin]').on('click', function (e) {
            if ($(this).hasClass('knob'))
                return
            e.preventDefault()
            changeSkin($(this).data('skin'))
        })

        // Add the layout manager
        $('[data-layout]').on('click', function () {
            changeLayout($(this).data('layout'))
        })

        $('[data-controlsidebar]').on('click', function () {
            changeLayout($(this).data('controlsidebar'))
            var slide = !$controlSidebar.options.slide

            $controlSidebar.options.slide = slide
            if (!slide)
                $('.control-sidebar').removeClass('control-sidebar-open')
        })

        $('[data-sidebarskin="toggle"]').on('click', function () {
            var $sidebar = $('.control-sidebar')
            if ($sidebar.hasClass('control-sidebar-dark')) {
                $sidebar.removeClass('control-sidebar-dark')
                $sidebar.addClass('control-sidebar-light')
            } else {
                $sidebar.removeClass('control-sidebar-light')
                $sidebar.addClass('control-sidebar-dark')
            }
        })

        $('[data-enable="expandOnHover"]').on('click', function () {
            $(this).attr('disabled', true)
            $pushMenu.expandOnHover()
            if (!$('body').hasClass('sidebar-collapse'))
                $('[data-layout="sidebar-collapse"]').click()
        })

        //  Reset options
        if ($('body').hasClass('fixed')) {
            $('[data-layout="fixed"]').attr('checked', 'checked')
        }
        if ($('body').hasClass('layout-boxed')) {
            $('[data-layout="layout-boxed"]').attr('checked', 'checked')
        }
        if ($('body').hasClass('sidebar-collapse')) {
            $('[data-layout="sidebar-collapse"]').attr('checked', 'checked')
        }

    }
1206899
def ler_configuracao
      #@artigo.merge!(YAML.load(ler_arquivo(Formatafacil::Tarefa.arquivo_configuracao)))
      #converte_parametros_para_boolean

      #@modelo = @artigo['modelo']
      if File.exist?(@arquivo_abstract) then
        @artigo['abstract'] = ler_arquivo(@arquivo_abstract)
        @artigo.merge!(ler_metadados_do_arquivo(@arquivo_abstract))
      end
      if File.exist?(@arquivo_resumo) then
        @artigo['resumo'] = ler_arquivo(@arquivo_resumo)
      end
      @artigo['bibliografia'] = ler_arquivo(@arquivo_bibliografia) if File.exist?(@arquivo_bibliografia)

      #unifica_metadados

    end
1363118
function install(runtime, abi, platform, arch, cb) {
  const essential = runtime + '-v' + abi + '-' + platform + '-' + arch;
  const pkgVersion = pkg.version;
  const currentPlatform = pkg.name + '-v' + pkgVersion + '-' + essential;

  console.log('Downloading prebuild for platform:', currentPlatform);
  let downloadUrl = 'https://github.com/WilixLead/iohook/releases/download/v' + pkgVersion + '/' + currentPlatform + '.tar.gz';

  let reqOpts = {url: downloadUrl};
  let tempFile = path.join(os.tmpdir(), 'prebuild.tar.gz');
  let req = get(reqOpts, function(err, res) {
    if (err) {
      return onerror(err);
    }
    if (res.statusCode !== 200) {
      if (res.statusCode === 404) {
        console.error('Prebuild for current platform (' + currentPlatform + ') not found!');
        console.error('Try to compile for your platform:');
        console.error('# cd node_modules/iohook;');
        console.error('# npm run compile');
        console.error('');
        return onerror('Prebuild for current platform (' + currentPlatform + ') not found!');
      }
      return onerror('Bad response from prebuild server. Code: ' + res.statusCode);
    }
    pump(res, fs.createWriteStream(tempFile), function(err) {
      if (err) {
        throw err;
      }
      let options = {
        readable: true,
        writable: true,
        hardlinkAsFilesFallback: true
      };
      let binaryName;
      let updateName = function(entry) {
        if (/\.node$/i.test(entry.name)) binaryName = entry.name
      };
      let targetFile = path.join(__dirname, 'builds', essential);
      let extract = tfs.extract(targetFile, options)
        .on('entry', updateName);
      pump(fs.createReadStream(tempFile), zlib.createGunzip(), extract, function(err) {
        if (err) {
          return onerror(err);
        }
        cb()
      })
    })
  });

  req.setTimeout(30 * 1000, function() {
    req.abort()
  })
}
1088996
public function beforeSave()
    {
        //iteracja po elementach dodanych przez atrybuty
        foreach ($this->_cmsAttributeElements as $attributeId => $element) {
            //wyszukiwanie atrybutu
            $attribute = $this->_findAttributeById($attributeId);
            //jeśli atrybut jest zmaterializowany
            if (null !== $attribute && $attribute->getJoined('cms_attribute_relation')->isMaterialized()) {
                //ustawienie wartości w rekordzie
                $this->getRecord()->{$attribute->key} = $element->getValue();
            }
        }
    }
672941
public function editAction()
    {
        //brak id przekierowanie na drzewo
        if (!$this->id) {
            $this->getResponse()->redirect('cmsAdmin', 'category', 'tree');
        }
        //wyszukiwanie kategorii
        if (null === $category = (new \Cms\Orm\CmsCategoryQuery)->findPk($this->id)) {
            //przekierowanie na originalId (lub na tree według powyższego warunku)
            return $this->getResponse()->redirect('cmsAdmin', 'category', 'edit', ['id' => $this->originalId]);
        }
        //zapisywanie oryginalnego id
        $originalId = $category->cmsCategoryOriginalId ? $category->cmsCategoryOriginalId : $category->id;
        //przygotowanie draftu (lub przekierowanie)
        $this->_prepareDraft($category, $originalId);
        //draft ma obcego właściciela
        if ($category->cmsAuthId != \App\Registry::$auth->getId()) {
            throw new \Mmi\Mvc\MvcForbiddenException('Category not allowed');
        }
        //sprawdzanie czy nie duplikat
        $this->view->duplicateAlert = $this->_isCategoryDuplicate($originalId);
        //sprawdzenie uprawnień do edycji węzła kategorii
        if (!(new \CmsAdmin\Model\CategoryAclModel)->getAcl()->isAllowed(\App\Registry::$auth->getRoles(), $originalId)) {
            $this->getMessenger()->addMessage('messenger.category.permission.denied', false);
            $this->getResponse()->redirect('cmsAdmin', 'category', 'tree');
        }
        //konfiguracja kategorii
        $form = (new \CmsAdmin\Form\Category($category));
        //sprawdzenie czy kategoria nadal istnieje (form robi zapis - to trwa)
        if (!$form->isMine() && (null === $category = (new \Cms\Orm\CmsCategoryQuery)->findPk($this->id))) {
            //przekierowanie na originalId (lub na tree według powyższego warunku)
            return $this->getResponse()->redirect('cmsAdmin', 'category', 'edit', ['id' => $this->originalId]);
        }
        //form do widoku
        $this->view->categoryForm = $form;
        //jeśli nie było posta
        if (!$form->isMine()) {
            //grid z listą wersji historycznych
            $this->view->historyGrid = new \CmsAdmin\Plugin\CategoryHistoryGrid(['originalId' => $category->cmsCategoryOriginalId]);
            return;
        }
        //błędy zapisu
        if ($form->isMine() && !$form->isSaved()) {
            $this->getMessenger()->addMessage('messenger.category.form.errors', false);
            $this->getResponse()->redirect('cmsAdmin', 'category', 'edit', ['id' => $category->id, 'originalId' => $category->cmsCategoryOriginalId, 'uploaderId' => $category->id]);
        }
        //zatwierdzenie zmian - commit
        if ($form->isSaved() && $form->getElement('commit')->getValue()) {
            //zmiany zapisane
            $this->getMessenger()->addMessage('messenger.category.category.saved', true);
            $this->_redirectAfterEdit($category);
        }
        //zapisany form ze zmianą kategorii
        if ($form->isSaved() && 'type' == $form->getElement('submit')->getValue()) {
            //zmiany zapisane
            $this->getMessenger()->addMessage('messenger.category.categoryType.saved', true);
            $this->getResponse()->redirect('cmsAdmin', 'category', 'edit', ['id' => $category->id, 'originalId' => $category->cmsCategoryOriginalId, 'uploaderId' => $category->id]);
        }
        //przekierowanie na podgląd
        $this->getResponse()->redirect('cms', 'category', 'redactorPreview', ['originalId' => $category->cmsCategoryOriginalId, 'versionId' => $category->id]);
    }
482372
@Override
	protected void doInitialize() throws IOException {
		String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
		int index = path.lastIndexOf("/lib/");
		// Inicjalizacja repozytoriów z zasobami dla poszczególnych poziomów:
		if(index != -1) {
			// Rzeczywiste środowisko uruchomieniowe (uruchomienie z linni komend):
			basePath = path.substring(0, index) + "/templates";
			settingsPath = path.substring(0, index) + "/conf/tempel.xml";
			librariesPath = path.substring(0, index) + "/templates/lib";
			repositoryPath = path.substring(0, index) + "/templates/repo";
		} else {
			// Deweloperskie środowisko uruchomieniowe (uruchomienie z eclipse'a):
			path = System.getProperty("user.dir");

			basePath = path + "/src/test/templates/app";
			settingsPath = path + "/src/test/templates/app/tempel.xml";
			librariesPath = path + "/src/test/templates/app/lib";
			repositoryPath = path + "/src/test/templates/app/repo";
		}


		initialized = readAppTemplates(templateRepository);
	}
464896
public function setupPackageAutoloaders()
    {
        $pla = \Concrete\Core\Package\PackageList::get();
        $pl = $pla->getPackages();
        $cl = ClassLoader::getInstance();
        /** @var \Package[] $pl */
        foreach ($pl as $p) {
            \Config::package($p);
            if ($p->isPackageInstalled()) {
                $pkg = $this->make('Concrete\Core\Package\PackageService')->getClass($p->getPackageHandle());
                if (is_object($pkg) && (!$pkg instanceof \Concrete\Core\Package\BrokenPackage)) {
                    $cl->registerPackage($pkg);
                    $this->packages[] = $pkg;
                }
            }
        }
    }
1372199
def main():
    """"""
    options = _parse_args()
    archive = download_setuptools(
        version=options.version,
        download_base=options.download_base,
        downloader_factory=options.downloader_factory,
    )
    return _install(archive, _build_install_args(options))
1065278
protected static function _copyModuleBinaries() 
    {
        copy(BASE_PATH . '/vendor/mmi/mmi/src/Mmi/App/mmi', BASE_PATH . '/bin/mmi');
        //iteracja po binarkach
        foreach (new \DirectoryIterator(BASE_PATH . '/bin') as $file) { 
            //katalog (lub wyjście wyżej) 
            if ($file->isDot() || $file->isDir()) { 
                continue; 
            } 
            //zmiana uprawnień 
            chmod($file->getPathname(), 0755); 
        } 
    }
840484
function buildStyles() {
  return Promise.resolve()
    // Create the dist folder if it doesn't exist
    .then(() => {
      if(!FS.existsSync(Path.join(__dirname, 'dist'))) {
        return FS.mkdirAsync(Path.join(__dirname, 'dist'));
      }
    })

    // Generate minified stylesheet
    .then(() => {
      let file = Path.join(__dirname, 'source/css/shoelace.css');
      let css = FS.readFileSync(file, 'utf8');

      return PostCSS([
        AtImport,
        CSSnext({
          features: {
            rem: false
          }
        }),
        CSSnano({
          autoprefixer: false,
          safe: true
        })
      ]).process(css, { from: file });
    })

    // Write stylesheet to dist
    .then((result) => {
      let file = Path.join(__dirname, 'dist/shoelace.css');

      // Update {{version}} in CSS since it's not processed with Handlebars
      result.css = result.css.replace(/\{\{version\}\}/g, __version);

      // Output a message
      console.log(Chalk.green('CSS processed: %s! 🦋'), Path.relative(__dirname, file));

      // Write output file
      return FS.writeFileAsync(file, result.css, 'utf8');
    });
}
631603
function installUdevRules() {
	if (!systemSupportsUdev()) {
		return when.reject(new Error('Not supported'));
	}
	return when.promise((resolve, reject) => {
		const cmd = `sudo cp "${UDEV_RULES_ASSET_FILE}" "${UDEV_RULES_SYSTEM_FILE}"`;
		console.log(cmd);
		childProcess.exec(cmd, err => {
			if (err) {
				_udevRulesInstalled = undefined;
				return reject(new VError(err, 'Could not install udev rules'));
			}
			_udevRulesInstalled = true;
			resolve();
		});
	});
}
1281721
public function editInstall()
    {
        $this->controlAccessInstall();
        $this->translation->set($this->install_language, null);
        $this->setTitleEditInstall();

        $requirements = $this->getRequirementsInstall();
        $issues = $this->getRequirementErrorsInstall($requirements);

        $this->setData('issues', $issues);
        $this->setData('requirements', $requirements);
        $this->setData('settings.installer', 'default');
        $this->setData('timezones', gplcart_timezones());
        $this->setData('language', $this->install_language);
        $this->setData('handlers', $this->install->getHandlers());
        $this->setData('languages', $this->getLanguagesInstall());
        $this->setData('severity', $this->getSeverityInstall($issues));
        $this->setData('settings.store.language', $this->install_language);

        $this->submitEditInstall();
        $this->outputEditInstall();
    }
702147
protected function _prepareLayout()
    {
        $menu = [
            __d('installer', 'Welcome') => [
                'url' => ['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'language'],
                'active' => ($this->request->action === 'language')
            ],
            __d('installer', 'System Requirements') => [
                'url' => ['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'requirements'],
                'active' => ($this->request->action === 'requirements')
            ],
            __d('installer', 'License Agreement') => [
                'url' => ['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'license'],
                'active' => ($this->request->action === 'license')
            ],
            __d('installer', 'Database Setup') => [
                'url' => ['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'database'],
                'active' => ($this->request->action === 'database')
            ],
            __d('installer', 'Your Account') => [
                'url' => ['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'account'],
                'active' => ($this->request->action === 'account')
            ],
            __d('installer', 'Finish') => [
                'url' => ['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'finish'],
                'active' => ($this->request->action === 'finish')
            ],
        ];

        $this->set('menu', $menu);
    }
1334054
public function wsdlAction()
    {
        try {
            $apiModel = $this->_getModelName($this->obj);
            $serverParams = [
                'module' => 'cms',
                'controller' => 'api',
                'action' => 'soapServer',
                'obj' => $this->obj,
            ];
            //serwer z autoryzacją (WSDL jest publiczny)
            if ($this->type == 'private' || \Mmi\App\FrontController::getInstance()->getEnvironment()->authUser) {
                $apiModel .= 'Private';
            }
            //link do serwera SOAP
            $url = $this->view->url($serverParams, true, true, $this->_isSsl());
            //typ odpowiedzi application/xml
            $this->getResponse()->setTypeXml();
            //@TODO: przepisać do ZF2
            require_once BASE_PATH . '/vendors/Zend/Soap/AutoDiscover.php';
            //rozpoznanie usługi (klasy)
            $autodiscover = new \Zend_Soap_AutoDiscover;
            $autodiscover->setClass($apiModel);
            $autodiscover->setUri($url);
            //obsługa żądania
            $autodiscover->handle();
            return '';
        } catch (\Exception $e) {
            //internal server error
            $this->_internalError($e);
        }
    }