// ###################################################################
-/*
-$show['props'] = false;
-$proplist = '';
-if (sizeof($latest['properties']) > 0)
-{
- $show['props'] = true;
- foreach ($latest['properties'] AS $propname => $propval)
- {
- $data = sprintf($lang->string('Property <strong>%1$s</strong> set to <em>%2$s</em>'), $propname, $propval);
- eval('$proplist .= "' . $template->fetch('property') . '";');
- }
-}
-*/
+$props = $revision->getPropsForPath($input->in['path']);
+$show['props'] = (sizeof($props) > 0);
+$proplist = FormatPropList($props);
// ###################################################################
$this->_fetchRevision($rev);
}
+ // ###################################################################
+ /**
+ * Returns an array of properties for this revision at a certain path
+ *
+ * @param string Path
+ *
+ * @return array Array of properties
+ */
+ public function getPropsForPath($path)
+ {
+ $output = BSRegister::Get('lib')->run('proplist -v -r' . $this->revision . ' ' . BSRegister::Get('lib')->arg($this->path . $path));
+ unset($output[0]);
+
+ $proplist = array();
+ foreach ($output AS $line)
+ {
+ if (preg_match('#^\s+(.*)\s:(\s(.*))?#', $line, $matches))
+ {
+ $curprop = $matches[1];
+ $proplist["$curprop"] = $matches[2] . "\n";
+ }
+ else
+ {
+ $proplist["$curprop"] .= $line . "\n";
+ }
+ }
+
+ return $proplist;
+ }
+
// ###################################################################
/**
* Gets the desired XML revision information from the repository
return $html;
}
+// ###################################################################
+/**
+* Formats an array of properties into a compiled HTML template
+*
+* @param array Array of properties
+*
+* @return string Compiled HTML property list
+*/
+function FormatPropList($props)
+{
+ if (sizeof($props) < 0)
+ {
+ return '';
+ }
+ foreach ($props AS $propname => $propval)
+ {
+ $data = sprintf(_('Property <strong>%1$s</strong> set to <em>%2$s</em>'), $propname, $propval);
+ eval('$proplist .= "' . BSRegister::Get('template')->fetch('property') . '";');
+ }
+ return $proplist;
+}
+
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
// ###################################################################
-$show['props'] = false;
-$proplist = '';
-if (sizeof($latest['properties']) > 0)
-{
- $show['props'] = true;
- foreach ($latest['properties'] AS $propname => $propval)
- {
- $data = sprintf($lang->string('Property <strong>%1$s</strong> set to <em>%2$s</em>'), $propname, $propval);
- eval('$proplist .= "' . $template->fetch('property') . '";');
- }
-}
+$props = $revision->getPropsForPath($input->in['path']);
+$show['props'] = (sizeof($props) > 0);
+$proplist = FormatPropList($props);
// ###################################################################