private function walk_path($folder, $options = null, $path = "") { if (is_null($options)) { $options = array(); } if ($folder) { $source = $this->_getParam("source_methodname"); if (Pimcore_Version::getRevision() > 3303) { $object_name = "Pimcore\\Model\\Object\\" . ucfirst($this->_getParam("source_classname")); } else { $object_name = "Object_" . ucfirst($this->_getParam("source_classname")); } $children = $folder->getChilds(); $usesI18n = sizeof($children) > 0 && $this->isUsingI18n($children[0], $source); $current_lang = $this->_getParam("current_language"); if (!Pimcore_Tool::isValidLanguage($current_lang)) { $languages = Pimcore_Tool::getValidLanguages(); $current_lang = $languages[0]; // TODO: Is this sensible? } foreach ($children as $child) { $class = get_class($child); switch ($class) { case "Object_Folder": /** * @var Object_Folder $child */ $key = $child->getProperty("Taglabel") != "" ? $child->getProperty("Taglabel") : $child->getKey(); if ($this->_getParam("source_recursive") == "true") { $options = $this->walk_path($child, $options, $path . $this->separator . $key); } break; case $object_name: $key = $usesI18n ? $child->{$source}($current_lang) : $child->{$source}(); $options[] = array("value" => $child->getId(), "key" => ltrim($path . $this->separator . $key, $this->separator)); if ($this->_getParam("source_recursive") == "true") { $options = $this->walk_path($child, $options, $path . $this->separator . $key); } break; } } } return $options; }
<!-- some javascript --> <?php // pimcore constants ?> <script type="text/javascript"> pimcore.settings = { upload_max_filesize: <?php echo $this->upload_max_filesize; ?> , sessionId: "<?php echo htmlentities($_COOKIE["pimcore_admin_sid"], ENT_QUOTES, 'UTF-8'); ?> ", version: "<?php echo Pimcore_Version::getVersion(); ?> ", build: "<?php echo Pimcore_Version::$revision; ?> ", maintenance_active: <?php echo $this->maintenance_enabled; ?> , maintenance_mode: <?php echo Pimcore_Tool_Admin::isInMaintenanceMode() ? "true" : "false"; ?> , mail: <?php