Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug fixes

  • Loading branch information...
commit 83f08e148ac9b6de13932d7b23c434419bff37d0 1 parent 368da9d
@murraypicton authored
Showing with 13 additions and 10 deletions.
  1. +2 −0  doqument.js
  2. +11 −10 doqumentor.php
View
2  doqument.js
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with Doqumentor. If not, see <http://www.gnu.org/licenses/>.
*/
+$(function() {
mydoc = $('#doqument');
elements = mydoc.find('.constant, .function, .class, .method');
elements.find('H2').addClass('ui-widget-header').addClass('ui-corner-all').css('padding-left', ' 0.5em').css('cursor', 'pointer');
@@ -39,6 +40,7 @@ mydoc.dialog({
height: dialogHeight,
title: 'Doqumentor'
});
+});
function show(elm) {
elm.children().show();
View
21 doqumentor.php
@@ -120,7 +120,8 @@ private function __construct($showall = false) {
/**
* Sort all my arrays into alphabetical order
*/
- asort($this->constants);
+ if(is_array($this->constants))
+ asort($this->constants);
usort($this->functions, array($this, 'sort'));
usort($this->classes, array($this, 'sort'));
}
@@ -137,7 +138,7 @@ private function __construct($showall = false) {
protected function parseFunctions($functions) {
$functionList = array();
foreach($functions as $func) {
- $functionList[] = new \ReflectionFunction($func);
+ $functionList[] = new ReflectionFunction($func);
}
return $functionList;
}
@@ -154,7 +155,7 @@ protected function parseFunctions($functions) {
protected function parseClasses($classes) {
$classList = array();
foreach($classes as $class) {
- $classList[] = new \ReflectionClass($class);
+ $classList[] = new ReflectionClass($class);
}
return $classList;
}
@@ -162,12 +163,12 @@ protected function parseClasses($classes) {
/**
* Custom sort function that sorts according to short name
*
- * @param mixed $item1 Reflection object with method getShortName
- * @param mixed $item2 Reflection object with method getShortName
+ * @param mixed $item1 Reflection object with method getName
+ * @param mixed $item2 Reflection object with method getName
* @return int
*/
protected function sort($item1, $item2) {
- return strcmp($item1->getShortName(), $item2->getShortName());
+ return strcmp($item1->getName(), $item2->getName());
}
/**
@@ -211,8 +212,8 @@ protected function formatParameters($params) {
protected function formatItem($item, $type = 'unknown') {
$html = '';
- $html .= "<div class=\"$type\" title=\"" . strtolower($item->getShortName()) . "\">" . PHP_EOL;
- $html .= "<h2>$type " . $item->getShortName();
+ $html .= "<div class=\"$type\" title=\"" . strtolower($item->getName()) . "\">" . PHP_EOL;
+ $html .= "<h2>$type " . $item->getName();
if(is_a($item, 'ReflectionFunction') || is_a($item, 'ReflectionMethod'))
$html .= "(" . $this->formatParameters($item->getParameters()) . ")";
@@ -245,7 +246,7 @@ protected function formatItem($item, $type = 'unknown') {
* @return string jquery.js formatted between <script> tags
*/
protected function jquery() {
- return "<script> " . file_get_contents('jquery.js', FILE_USE_INCLUDE_PATH) . "</script>";
+ //return "<script> " . file_get_contents('jquery.js', FILE_USE_INCLUDE_PATH) . "</script>";
}
/**
@@ -435,7 +436,7 @@ public function get() {
public function display() {
echo $this->get();
if($this->jquery) {
- echo "<div style=\"position: absolute; bottom: 10px; right: 10px\"><a href=\"#\" onclick=\"$('#doqument').dialog('open'); return false;\"><img src=\"" . $this->imagePath . "\" border=\"0\" /></a></div>";
+ echo "<div style=\"position: fixed; bottom: 0px; right: 0px\"><a href=\"#\" onclick=\"$('#doqument').dialog('open'); return false;\"><img src=\"" . $this->imagePath . "\" border=\"0\" /></a></div>";
echo $this->jquery();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.