Get views location for the specified resource.

@param string $resourceName The name of the resource

@return string
517253
public function getViewsLocation($resourceName = null)
    {
        $resourceName = $resourceName ?? $this->resourceName;
        return $this->module.$this->theme.$resourceName;
    }
738647
protected function getResourceInfo($fullPathName)
  {
    foreach ($this->resourceFilesInfo as $info)
    {
      if ($info['full_path_name']===$fullPathName)
      {
        return $info;
      }
    }

    $this->logError("Unknown resource file '%s'", $fullPathName);

    return null;
  }
512806
protected function getViewPath()
    {
        $key = $this->form->getResourceId();

        if ($key) {
            return $this->getListPath().'/'.$key;
        } else {
            return $this->getListPath();
        }
    }
504100
public function getResourceForBlockName(BaseView $view, string $blockName)
    {
        $cacheKey = $view->vars[self::CACHE_KEY_VAR];

        if (!isset($this->resources[$cacheKey][$blockName])) {
            $this->loadResourceForBlockName($cacheKey, $view, $blockName);
        }

        return $this->resources[$cacheKey][$blockName];
    }
1122242
public function getLocationByClassName($className)
    {
        if (is_object($className)) $className = get_class($className);
        if (isset($this->known[$className]['location'])) {
            return $this->known[$className]['location'];
        } else {
            return null;
        }
    }
339810
private CmsResource getResource(CmsObject cms, String resourcename) {

        return getResource(cms, resourcename, CmsResourceFilter.DEFAULT);
    }
687767
public function get(
        $root = null,
        $siteId = null,
        $pages = null,
        $pageType = null,
        $pageName = null
    ) {
        if (empty($root)) {
            $root = self::RESOURCE_SITES;
        }

        if (empty($siteId)) {
            return $root;
        }

        if (empty($pages)) {
            return $root . '.' . $siteId;
        }

        if (empty($pageType) || empty($pageName)) {
            return $root . '.' . $siteId . '.' . $pages;
        }

        return $root . '.' . $siteId . '.' . $pages . '.' . $pageType . '.' . $pageName;
    }
578470
protected function getDestinationViewFullname($viewsDirectory, $routesPrefix, $viewName = null)
    {
        $viewsPath = $this->getFullViewsPath($viewsDirectory, $routesPrefix);

        $filename = $this->getDestinationViewName($viewName ?: $this->getViewType());

        return $this->getDestinationPath($viewsPath) . $filename;
    }
542230
function findControllerForView ($viewName)
  {
    /** @var DocumentContext $this */
    $path = $this->viewService->resolveTemplatePath ($viewName, $base);
//    inspect ($viewName, $base, $path);
    if (isset($this->controllers[$path]))
      return $this->controllers[$path];

    foreach ($this->controllerNamespaces as $nsPath => $ns) {
//      inspect ($nsPath, $ns);
      if (str_beginsWith ($path, $nsPath)) {
        $remaining = substr ($path, strlen ($nsPath) + 1);
        $a         = PS ($remaining)->split ('/');
        $file      = $a->pop ();
        $nsPrefix  = $a->map ('ucfirst', false)->join ('\\')->S;
        $class     = ($p = strpos ($file, '.')) !== false
          ? ucfirst (substr ($file, 0, $p))
          : ucfirst ($file);
        $FQN       = PA ([$ns, $nsPrefix, $class])->prune ()->join ('\\')->S;
//        inspect ("CLASS $FQN");
        if (class_exists ($FQN))
          return $FQN;
      }
    }
//    inspect ("CLASS NOT FOUND FOR VIEW $viewName");
    return null;
  }
843985
private function getListTemplateFromConfigName($viewName)
    {
        if (isset($this->viewToListViewMapping[$viewName])) {
            return $this->viewToListViewMapping[$viewName];
        }

        return current($this->viewToListViewMapping);
    }
1224618
public function locateViewFile($filename, $requiredNamespace = '')
    {
        foreach ($this->templateSearchDirectories as $namespace => $location) {
            if (!empty($requiredNamespace) && ($namespace != $requiredNamespace)) {
                continue;
            }

            $fullFilename = $location . DIRECTORY_SEPARATOR . str_replace('..', '', $filename);

            if (!$this->allowRecursion && ($fullFilename == $this->parentTemplate)) {
                if (!empty($this->log))
                {
                    $this->log->error("Disallowed template recursion found in filename " . $filename . ". To allow recursion, send _allowRecursion=true into the template data.");
                }
                return '';
            }

            if (is_file($fullFilename)) {
                return $fullFilename;
            }
        }

        if (!empty($this->log))
        {
            $this->log->error("Invalid template filename specified " . $filename);
        }

        return '';
    }
1226957
public function find($name)
    {
        if (isset($this->views[$name])) {
            return $this->views[$name];
        }

        $name = trim($name);

		if ($this->hasHintInformation($name)) {
            return $this->views[$name] = $this->findNamespacedView($name);
        }
		
        $theme = app(ThemeManager::class);
        if ($theme->isUseTheme()) {
            $name = 'theme_' . $theme->getActiveTheme() . static::HINT_PATH_DELIMITER . $name;
            return $this->views[$name] = $this->findNamespacedView($name);
        }
		
        return $this->views[$name] = $this->findInPaths($name, $this->paths);
    }
978301
public function getSite(
        PhpRenderer $view
    ) {
        /** @var \Rcm\Entity\Site $site */
        $site = $view->site;

        /** Fix for non CMS pages */
        if (empty($site)) {
            $site = $this->currentSite;
        }

        return $site;
    }
995249
private function getPath($resourceId = null)
    {
        if (!is_null($resourceId)) {
            $endpoint = ($this->isOrder($resourceId) ? Orders::PATH : Payment::PATH);

            return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, $endpoint, $resourceId, self::PATH);
        }

        if ($this->order !== null) {
            return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, Orders::PATH, $this->order->getId(), self::PATH);
        }

        return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, Payment::PATH, $this->payment->getId(), self::PATH);
    }
587563
public static function view_resource($resourceid) {
        global $DB, $CFG;
        require_once($CFG->dirroot . "/mod/resource/lib.php");

        $params = self::validate_parameters(self::view_resource_parameters(),
                                            array(
                                                'resourceid' => $resourceid
                                            ));
        $warnings = array();

        // Request and permission validation.
        $resource = $DB->get_record('resource', array('id' => $params['resourceid']), '*', MUST_EXIST);
        list($course, $cm) = get_course_and_cm_from_instance($resource, 'resource');

        $context = context_module::instance($cm->id);
        self::validate_context($context);

        require_capability('mod/resource:view', $context);

        // Call the resource/lib API.
        resource_view($resource, $course, $cm, $context);

        $result = array();
        $result['status'] = true;
        $result['warnings'] = $warnings;
        return $result;
    }
1305014
public function getFilePath($filename)
    {
        if (modules()) {
            $filePaths = modules()->getDirs('Views');
        } else {
            $filePaths = array_reverse($this->filePaths);
        }

        foreach ($filePaths as $filePath) {
            if (is_file($filePath . $filename . '.phtml')) {
                return $filePath . $filename . '.phtml';
                break;
            } elseif (is_file($filePath . 'errors' . DIRECTORY_SEPARATOR . $filename . '.phtml')) {
                return $filePath . 'errors' . DIRECTORY_SEPARATOR . $filename . '.phtml';
                break;
            }
        }
    }
575622
public static function view($fileName)
	{
		//explode the view files name into array
        $array = explode("/", $fileName);

        if(count($array) == 1) $array = explode('.',$fileName);

		return Registry::getConfig()['root'] . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . join(DIRECTORY_SEPARATOR, $array) . '.glade.php';

	}