/** * Retrieves data from the current session. The data is accessed by "key". * * @param mixed the key * @return void */ public function loadFromSession($key) { session_start(); if ($className = $_SESSION[$key . '.']['className']) { tx_div2007::load($className); session_write_close(); session_start(); $this->overwriteArray($_SESSION[$key]); } }
public function getPageData() { $classObject = tx_div2007::makeInstance('tx_div2007_object', $this->controller, $GLOBALS['TSFE']->page); return $classObject; }
/** * Creates a parameters object. * * @return the parameters object * @access protected */ public function _createParameters() { $classObject = tx_div2007::makeInstance($this->parametersClassName, $this); return $classObject; }
/** * Find path to load * * see load * * @param string classname * @param string extension key that varies from classnames * @param string prefix of classname * @param string ending of classname * @return string the path, FALSE if invalid * @see load() */ function _find($minimalInformation, $alternativeKey = '', $prefix = 'class.', $suffix = '.php') { $info = trim($minimalInformation); $path = ''; if (!$info) { $error = 'emptyParameter'; } if (!$error) { $qSuffix = preg_quote($suffix, '/'); // If it is a path extract the key first. // Either the relevant part starts with a slash: xyz/[tx_].....php if (preg_match('/^.*\\/([0-9A-Za-z_]+)' . $qSuffix . '$/', $info, $matches)) { $class = $matches[1]; } elseif (preg_match('/^.*\\.([0-9A-Za-z_]+)' . $qSuffix . '$/', $info, $matches)) { // Or it starts with a Dot: class.[tx_]....php $class = $matches[1]; } elseif (preg_match('/^([0-9A-Za-z_]+)' . $qSuffix . '$/', $info, $matches)) { // Or it starts directly with the relevant part $class = $matches[1]; } elseif (preg_match('/^[0-9a-zA-Z_]+$/', trim($info), $matches)) { // It may be the key itself $class = $info; } else { $error = 'classError'; } } // With this a possible alternative Key is also validated if (!$error && !($key = tx_div2007::guessKey($alternativeKey ? $alternativeKey : $class))) { $error = 'classError'; } if (!$error) { if (preg_match('/^tx_[0-9A-Za-z_]*$/', $class)) { // with tx_ prefix $parts = explode('_', trim($class)); array_shift($parts); // strip tx } elseif (preg_match('/^[0-9A-Za-z_]*$/', $class)) { // without tx_ prefix $parts = explode('_', trim($class)); } else { $error = 'classError'; } } if (!$error) { // Set extPath for key (first element) $first = array_shift($parts); // Save last element of path if (count($parts) > 0) { $last = array_pop($parts) . '/'; } $dir = ''; // Build the relative path if any foreach ((array) $parts as $part) { $dir .= $part . '/'; } // if an alternative Key is given use that $ext = t3lib_extMgm::extPath($key); // First we try ABOVE last directory (dir and last may be empty) // ext(/dir)/last // ext(/dir)/prefix.tx_key_parts_last.php. if (!$path && !is_file($path = $ext . $dir . $prefix . $class . $suffix)) { $path = FALSE; } // Now we try INSIDE the last directory (dir and last may be empty) // ext(/dir)/last // ext(/dir)/last/prefix.tx_key_parts_last.php. if (!$path && !is_file($path = $ext . $dir . $last . $prefix . $class . $suffix)) { $path = FALSE; } } return $path; }
/** * Returns a new iterator object for this array. * * @return object the new iterator */ public function getIterator() { $iteratorClass = $this->iteratorClass; tx_div2007::loadClass('class.' . $iteratorClass . '.php'); $result = new $iteratorClass($this->array); return $result; }