Search for exclusive module CMS pages created in Project folder for this individual site

@param string $module
334430
public static function requireModule($module)
    {
        // Check for module itself
        $file_path = DIR_MODULES . $module . '/' . 'Module' . Converter::toCamelCase($module) . '.php';
        if (file_exists($file_path)) {
            require_once $file_path;

            // Inner panel file
            if (MODE == 'cms') {
                $file_path = DIR_MODULES . $module . '/' . 'Cms' . ucfirst($module) . '.php';
                if (file_exists($file_path)) {
                    require_once $file_path;
                }
            }
        }

        // Require all Entity files
        $objects_path = DIR_MODULES . $module . '/Entity/';
        if (file_exists($objects_path)) {
            foreach (array_diff(scandir($objects_path), ['.', '..']) as $object_file) {
                if (is_file($objects_path . $object_file)) {
                    require_once $objects_path . $object_file;
                }
            }
        }
    }
1333507
public function removeAllByModule($module)
    {
        foreach ($this->getIndexesByModule($module) as $index) {
            if (isset($this->data[$index])) {
                unset($this->data[$index]);
            }
        }
    }
125613
private function createModuleModels($module, $path)
    {
        $module_path = $path . $module;
        $module_path = str_replace(CORE_DIR . DIRECTORY_SEPARATOR, '', $module_path);

        $configGenerator = $this->getConfigGenerator($module_path);

        $this->buildModels($configGenerator);
        $this->buildSql($configGenerator);

        $configTemplate = $this->tpl->dump("generator/config.propel.template.twig", array(
            "module" => $module,
        ));
        $this->writeTemplateToFile($configTemplate, CORE_DIR . DIRECTORY_SEPARATOR . $module_path . DIRECTORY_SEPARATOR . "Config" .
            DIRECTORY_SEPARATOR . "config.php", true);
        $this->log->addLog("Generado config genérico para propel");
    }
803253
public function setModulePosition($module, $position = 'position-7')
	{
		$this->amOnPage('administrator/index.php?option=com_modules');
		$this->searchForItem($module);
		$this->click(array('link' => $module));
		$this->waitForText("Modules: $module", 30, array('css' => 'h1.page-title'));
		$this->click(array('link' => 'Module'));
		$this->waitForElement(array('id' => 'general'), 30);
		$this->selectOptionInChosen('Position', $position);
		$this->click(array('xpath' => "//div[@id='toolbar-apply']/button"));
		$this->waitForText('Module saved', 30, array('id' => 'system-message-container'));
	}
583008
protected function autoFindController($module, &$path)
    {
        $dir = $this->app->getAppPath() . ($module ? $module . '/' : '') . $this->rule->getConfig('url_controller_layer');
        $suffix = $this->app->getSuffix() || $this->rule->getConfig('controller_suffix') ? ucfirst($this->rule->getConfig('url_controller_layer')) : '';

        $item = [];
        $find = false;

        foreach ($path as $val) {
            $item[] = $val;
            $file = $dir . '/' . str_replace('.', '/', $val) . $suffix . '.php';
            $file = pathinfo($file, PATHINFO_DIRNAME) . '/' . Loader::parseName(pathinfo($file, PATHINFO_FILENAME), 1) . '.php';
            if (is_file($file)) {
                $find = true;
                break;
            } else {
                $dir .= '/' . Loader::parseName($val);
            }
        }

        if ($find) {
            $controller = implode('.', $item);
            $path = array_slice($path, count($item));
        } else {
            $controller = array_shift($path);
        }

        return $controller;
    }
428733
public static function registerModulePath($path)
    {
        if (file_exists($path)) {
            self::$_modulePaths[] = $path;
        } else {
            user_error(__d('wasabi_cms', 'Module path {0} does not exist.', $path));
        }
    }
813233
public function hasModule($module)
    {
        foreach ($this->data as $index => $row) {
            if ($row[ConstProviderInterface::CONFIG_PARAM_MODULE] == $module) {
                return true;
            }
        }

        return false;
    }
71397
public function module($module = null)
    {
        if (!is_null($module)) {
            $this->module = $module;
            return $this;
        } else {
            return $this->module ?: '';
        }
    }
71138
static function ModuleCustomTemplatesFolder(TemplateModule $module)
    {
        $parentFolder = Path::Combine(PHINE_PATH, 'App/Phine/ModuleTemplates');
        $bundleFolder = Path::Combine($parentFolder, $module->MyBundle());
        return Path::Combine($bundleFolder, $module->MyName());
    }
661122
public function processModule($module)
    {
        if (!isset($this->registeredModules[$module]) || is_object($module)) {
            $this->registerModule($module);
        }
        $this->modules[$module] = $this->registeredModules[$module];
    }
580230
private function setByModule(string $module) : void
    {
        $config = (new ModuleConfig(ConfigType::MODULE(), $module))->parse();
        $fields = $this->getModuleFields($module);

        if (! property_exists($config, 'table')) {
            return;
        }

        if (! property_exists($config->table, 'type')) {
            return;
        }

        if ('module' === $config->table->type) {
            $this->setByTypeModule($module, $fields);
        }

        if ('relation' === $config->table->type) {
            $this->setByTypeRelation($module, $fields);
        }

        if ($module === $this->getTableName()) {
            $this->setByTypeFile($module, $fields);
        }
    }
1070173
private function getIndexesByModule($module)
    {
        // Indexes to be removed
        $indexes = array();

        foreach ($this->data as $index => $row) {
            if (isset($row[ConstProviderInterface::CONFIG_PARAM_MODULE]) && $row[ConstProviderInterface::CONFIG_PARAM_MODULE] == $module) {
                array_push($indexes, $index);
            }
        }

        return $indexes;
    }
320446
public final function registerModule(Module $module)
    {
        $dependencies = $module->getModules();

        foreach($dependencies as $dependency){
            $this->registerModule($dependency);
        }

        $this->modules[$module->getModuleName()] = $module;
    }
451985
public function setModule($module)
    {
        $this->module = is_string($module) ? $module : $this->$module;
        $this->prepareUrl();

        return $this;
    }
561266
public static function applyCurrentTheme($module = null) 
	{
		$theme = Yii::app()->theme->name;
		Yii::app()->theme = $theme;

		if($module !== null) {
			$themePath = Yii::getPathOfAlias('webroot.themes.'.$theme.'.views.layouts');
			$module->setLayoutPath($themePath);
		}
	}
416636
public function getTemplatesAsOptionsArray($module)
    {
        $availableTemplates = ['show'];
        $templates = glob(base_path('resources/themes/'.config('cms.frontend-theme').'/'.$module.'/*'));

        foreach ($templates as $template) {
            $template = str_replace(base_path('resources/themes/'.config('cms.frontend-theme').'/'.$module.'/'), '', $template);
            if (stristr($template, 'template')) {
                $template = str_replace('-template.blade.php', '', $template);
                if (!stristr($template, '.php')) {
                    $availableTemplates[] = $template.'-template';
                }
            }
        }

        return $availableTemplates;
    }
1367899
private static function copyDeltasFromPackage($module)
    {
        $docRoot = self::docRoot();
        $melisVendorPath = $docRoot . 'vendor/melisplatform/' . $module;
        $dbDeployPath = $docRoot . 'dbdeploy/data/';
        if (!file_exists($melisVendorPath)) {
            return;
        }
        if (!file_exists($dbDeployPath)) {
            mkdir($dbDeployPath, 0777, true);
        }
        // copy dbdeploy file
        $packageDbdeployFiles = $melisVendorPath . '/install/dbdeploy/';
        if (!file_exists($packageDbdeployFiles)) {
            return null;
        }
        $packageDbdeployFiles = glob($packageDbdeployFiles . '*.sql');
        $moduleName = self::toModuleName($module);

        print  "* $moduleName\r\n";
        $count = 1;
        $allExists = false;
        foreach ($packageDbdeployFiles as $idx => $file) {
            if (!file_exists($dbDeployPath . basename($file))) {
                $count = $idx + 1;
                print "    ($count) " . 'Publishing ' . $moduleName . '/' . basename($file) . ' => ' . $dbDeployPath . basename($file) . PHP_EOL;
                copy($file, $dbDeployPath . basename($file));
                self::$count++;
                $allExists = false;
            } else {
                $allExists = true;
            }

        }

        if ($allExists) {
            print  "    Nothing to publish" . PHP_EOL;
        }

        print PHP_EOL;
    }