Developer_Manual - Version 1.1.0

Version Notes

No Notes

Download this release

Release Info

Developer Magento Core Team
Extension Developer_Manual
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.2 to 1.1.0

Files changed (33) hide show
  1. app/code/local/Alanstormdotcom/Developermanual/Block/Abstractref.php +12 -0
  2. app/code/local/Alanstormdotcom/Developermanual/Block/Apiresource.php +8 -0
  3. app/code/local/Alanstormdotcom/Developermanual/Block/Renderer/Reflection/Action.php +18 -1
  4. app/code/local/Alanstormdotcom/Developermanual/Block/Renderer/Reflection/Api.php +5 -0
  5. app/code/local/Alanstormdotcom/Developermanual/Block/Renderer/Reflection/Helper.php +34 -0
  6. app/code/local/Alanstormdotcom/Developermanual/Block/Template.php +46 -34
  7. app/code/local/Alanstormdotcom/Developermanual/Helper/Data.php +12 -0
  8. app/code/local/Alanstormdotcom/Developermanual/Helper/Reflector.php +12 -0
  9. app/code/local/Alanstormdotcom/Developermanual/Helper/Xmlpp.php +12 -0
  10. app/code/local/Alanstormdotcom/Developermanual/Model/Apiref.php +28 -0
  11. app/code/local/Alanstormdotcom/Developermanual/Model/Helper.php +130 -0
  12. app/code/local/Alanstormdotcom/Developermanual/Model/Reflector/Helper.php +134 -0
  13. app/code/local/Alanstormdotcom/Developermanual/Model/Source/Helper.php +105 -0
  14. app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/Developermanual/ApiController.php +43 -0
  15. app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/Developermanual/HelperController.php +66 -0
  16. app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/Developermanual/IndexController.php +64 -0
  17. app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/DevelopermanualController.php +23 -0
  18. app/code/local/Alanstormdotcom/Developermanual/controllers/_ApiController.php +22 -0
  19. app/code/local/Alanstormdotcom/Developermanual/controllers/_HelperController.php +67 -0
  20. app/code/local/Alanstormdotcom/Developermanual/controllers/{IndexController.php → _IndexController.php} +13 -0
  21. app/code/local/Alanstormdotcom/Developermanual/etc/adminhtml.xml +34 -0
  22. app/code/local/Alanstormdotcom/Developermanual/etc/config.xml +8 -27
  23. app/code/local/Alanstormdotcom/Developermanual/templates/adminhtml_alanstormdotcom_developermanual_api_reference.phtml +41 -0
  24. app/code/local/Alanstormdotcom/Developermanual/templates/adminhtml_alanstormdotcom_developermanual_api_referenceall.phtml +15 -0
  25. app/code/local/Alanstormdotcom/Developermanual/templates/adminhtml_alanstormdotcom_developermanual_api_singleResource.phtml +0 -0
  26. app/code/local/Alanstormdotcom/Developermanual/templates/{alanstormdotcom_developermanual_index_about.phtml → adminhtml_alanstormdotcom_developermanual_index_about.phtml} +0 -0
  27. app/code/local/Alanstormdotcom/Developermanual/templates/ajax_helper_methods.phtml +326 -0
  28. app/code/local/Alanstormdotcom/Developermanual/templates/api_resource.phtml +40 -0
  29. app/code/local/Alanstormdotcom/Developermanual/templates/form_block_action.phtml +1 -1
  30. app/code/local/Alanstormdotcom/Developermanual/templates/form_helper_action.phtml +54 -0
  31. app/code/local/Alanstormdotcom/Developermanual/templates/helpers_css.phtml +50 -0
  32. app/code/local/Alanstormdotcom/Developermanual/templates/helpers_js.phtml +90 -0
  33. package.xml +4 -4
app/code/local/Alanstormdotcom/Developermanual/Block/Abstractref.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Exists so we have a referece to what exists at the abstract level
4
  * DON'T ADD METHODS
1
  <?php
2
+ /**
3
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
4
+ *
5
+ * The MIT License (MIT)
6
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
  /**
15
  * Exists so we have a referece to what exists at the abstract level
16
  * DON'T ADD METHODS
app/code/local/Alanstormdotcom/Developermanual/Block/Apiresource.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Block_Apiresource extends Alanstormdotcom_Developermanual_Block_Template
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->setTemplate('api_resource.phtml');
7
+ }
8
+ }
app/code/local/Alanstormdotcom/Developermanual/Block/Renderer/Reflection/Action.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Alanstormdotcom_Developermanual_Block_Renderer_Reflection_Action extends Mage_Core_Block_Text
3
  {
4
  const COMMENT_INDENT = ' ';
@@ -75,9 +87,14 @@
75
  return $this->_getNoDocumentation($method);
76
  }
77
 
 
 
 
 
78
  protected function _getYesDocumentation($method)
79
  {
80
- $lines = preg_split('%\*%', trim(str_replace('*/','',str_replace('/**','',$method->getDocComment()))),-1,PREG_SPLIT_NO_EMPTY);
 
81
 
82
  $output = array();
83
  $hit_at = false;
1
  <?php
2
+ /**
3
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
4
+ *
5
+ * The MIT License (MIT)
6
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
  class Alanstormdotcom_Developermanual_Block_Renderer_Reflection_Action extends Mage_Core_Block_Text
15
  {
16
  const COMMENT_INDENT = ' ';
87
  return $this->_getNoDocumentation($method);
88
  }
89
 
90
+ static public function normalizeDocComment($string)
91
+ {
92
+ return preg_split('%\*%', trim(str_replace('*/','',str_replace('/**','',$string))),-1,PREG_SPLIT_NO_EMPTY);
93
+ }
94
  protected function _getYesDocumentation($method)
95
  {
96
+ #$lines = preg_split('%\*%', trim(str_replace('*/','',str_replace('/**','',$method->getDocComment()))),-1,PREG_SPLIT_NO_EMPTY);
97
+ $lines = self::normalizeDocComment($method->getDocComment());
98
 
99
  $output = array();
100
  $hit_at = false;
app/code/local/Alanstormdotcom/Developermanual/Block/Renderer/Reflection/Api.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Block_Renderer_Reflection_Api extends Alanstormdotcom_Developermanual_Block_Template
3
+ {
4
+
5
+ }
app/code/local/Alanstormdotcom/Developermanual/Block/Renderer/Reflection/Helper.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Block_Renderer_Reflection_Helper extends Alanstormdotcom_Developermanual_Block_Template
3
+ {
4
+ public function parseParameters($params)
5
+ {
6
+ $list = array();
7
+ foreach($params as $param) {
8
+ $start = strpos($param['name'], '$');
9
+ $end = strpos($param['name'], ']');
10
+
11
+ $part = substr($param['name'], $start, $end - $start - 1);
12
+
13
+ $list[] = $part;
14
+ }
15
+
16
+ return '(' . implode(', ', $list) . ')';
17
+
18
+ }
19
+
20
+ protected function _parseDefault($default)
21
+ {
22
+ if(is_string($default)) {
23
+
24
+ } elseif(is_numeric($default)) {
25
+
26
+ } elseif(is_bool($default)) {
27
+
28
+ } elseif(is_null($default)) {
29
+
30
+ } elseif(is_array($default)) {
31
+
32
+ }
33
+ }
34
+ }
app/code/local/Alanstormdotcom/Developermanual/Block/Template.php CHANGED
@@ -1,36 +1,48 @@
1
  <?php
2
- class Alanstormdotcom_Developermanual_Block_Template extends Mage_Core_Block_Template
3
- {
4
- protected function _checkValidScriptPath($scriptPath)
5
- {
6
- $paths_to_check = array(Mage::getBaseDir('design'),Mage::getModuleDir('', 'Alanstormdotcom_Developermanual'));
7
- $valid = false;
8
- foreach($paths_to_check as $path)
9
- {
10
- if(strpos($scriptPath, realpath($path)) === 0)
11
- {
12
- $valid = true;
13
- }
14
- }
15
- return $valid;
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- public function setScriptPath($dir)
19
- {
20
- $scriptPath = realpath($dir);
21
- if ($this->_checkValidScriptPath($scriptPath)) {
22
- $this->_viewDir = $dir;
23
- } else {
24
- Mage::log('Not valid script path:' . $dir, Zend_Log::CRIT, null, null, true);
25
- }
26
- return $this;
27
- }
28
-
29
- public function fetchView($fileName)
30
- {
31
- //ignores file name, just uses a simple include with template name
32
- $path = Mage::getModuleDir('', 'Alanstormdotcom_Developermanual');
33
- $this->setScriptPath($path . '/templates');
34
- return parent::fetchView($this->getTemplate());
35
- }
36
- }
1
  <?php
2
+ /**
3
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
4
+ *
5
+ * The MIT License (MIT)
6
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
+ class Alanstormdotcom_Developermanual_Block_Template extends Mage_Adminhtml_Block_Template
15
+ {
16
+ protected function _checkValidScriptPath($scriptPath)
17
+ {
18
+ $paths_to_check = array(Mage::getBaseDir('design'),Mage::getModuleDir('', 'Alanstormdotcom_Developermanual'));
19
+ $valid = false;
20
+ foreach($paths_to_check as $path)
21
+ {
22
+ if(strpos($scriptPath, realpath($path)) === 0)
23
+ {
24
+ $valid = true;
25
+ }
26
+ }
27
+ return $valid;
28
+ }
29
 
30
+ public function setScriptPath($dir)
31
+ {
32
+ $scriptPath = realpath($dir);
33
+ if ($this->_checkValidScriptPath($scriptPath)) {
34
+ $this->_viewDir = $dir;
35
+ } else {
36
+ Mage::log('Not valid script path:' . $dir, Zend_Log::CRIT, null, null, true);
37
+ }
38
+ return $this;
39
+ }
40
+
41
+ public function fetchView($fileName)
42
+ {
43
+ //ignores file name, just uses a simple include with template name
44
+ $path = Mage::getModuleDir('', 'Alanstormdotcom_Developermanual');
45
+ $this->setScriptPath($path . '/templates');
46
+ return parent::fetchView($this->getTemplate());
47
+ }
48
+ }
app/code/local/Alanstormdotcom/Developermanual/Helper/Data.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Alanstormdotcom_Developermanual_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
  }
1
  <?php
2
+ /**
3
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
4
+ *
5
+ * The MIT License (MIT)
6
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
  class Alanstormdotcom_Developermanual_Helper_Data extends Mage_Core_Helper_Abstract
15
  {
16
  }
app/code/local/Alanstormdotcom/Developermanual/Helper/Reflector.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Alanstormdotcom_Developermanual_Helper_Reflector extends Mage_Core_Helper_Abstract
3
  {
4
  protected $_baseAbstractMethods=false;
1
  <?php
2
+ /**
3
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
4
+ *
5
+ * The MIT License (MIT)
6
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
  class Alanstormdotcom_Developermanual_Helper_Reflector extends Mage_Core_Helper_Abstract
15
  {
16
  protected $_baseAbstractMethods=false;
app/code/local/Alanstormdotcom/Developermanual/Helper/Xmlpp.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Alanstormdotcom_Developermanual_Helper_Xmlpp extends Mage_Core_Helper_Abstract
3
  {
4
  protected $_lastDepth = 0;
1
  <?php
2
+ /**
3
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
4
+ *
5
+ * The MIT License (MIT)
6
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ */
14
  class Alanstormdotcom_Developermanual_Helper_Xmlpp extends Mage_Core_Helper_Abstract
15
  {
16
  protected $_lastDepth = 0;
app/code/local/Alanstormdotcom/Developermanual/Model/Apiref.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Model_Apiref extends Varien_Object
3
+ {
4
+
5
+ public function _construct()
6
+ {
7
+ $config = Mage::getConfig()->loadModulesConfiguration('api.xml');
8
+ $api = $config->getNode('api');
9
+ $this->setNodeApi($api);
10
+ }
11
+
12
+ public function getResourceNodes()
13
+ {
14
+ return $this->getNodeApi()->resources->children();
15
+ }
16
+
17
+ public function getResourceByName($name)
18
+ {
19
+ foreach($this->getResourceNodes() as $node)
20
+ {
21
+ if((string)$node->getName() == $name)
22
+ {
23
+ return $node;
24
+ }
25
+ }
26
+ return false;
27
+ }
28
+ }
app/code/local/Alanstormdotcom/Developermanual/Model/Helper.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Model_Helper extends Mage_Core_Model_Abstract
3
+ {
4
+ protected $_configHelpers;
5
+
6
+ public function getClassinfo($filePath, $classAlias, $sort)
7
+ {
8
+ $classInfo = array();
9
+
10
+ $classInfo['filePath'] = $filePath;
11
+ $classInfo['fileParts'] = $this->_getPartsFromPath($filePath);
12
+ $groupName = $this->_getGroupName($classInfo['fileParts']['classPath'], $classInfo['fileParts']['module']);
13
+ $classInfo['groupName'] = $groupName;
14
+ $classInfo['alias'] = $classAlias;
15
+ $classInfo['rewrite'] = $this->_getRewrite($groupName, $classAlias, $classInfo['fileParts']['className']);
16
+
17
+ $reflector = Mage::getModel('alanstormdotcom_developermanual/reflector_helper', array($filePath,
18
+ $classInfo['fileParts']['className']));
19
+
20
+ $classInfo['parents'] = $reflector->getParents();
21
+ $classInfo['docComment'] = $reflector->getDocComment();
22
+ $classInfo['methods'] = $reflector->getMethods($classInfo['parents']);
23
+ $classInfo['properties'] = $reflector->getProperties($classInfo['parents']);
24
+ $classInfo['constants'] = $reflector->getConstants();
25
+
26
+ if($sort && strlen($sort) > 0) {
27
+ $this->_sortAll($classInfo, $sort);
28
+ }
29
+
30
+ return $classInfo;
31
+ }
32
+
33
+ protected function _getPartsFromPath($path)
34
+ {
35
+ $parts = explode('/', $path);
36
+ $return = array();
37
+ $return['codepool'] = $parts[2];
38
+ $return['namespace'] = $parts[3];
39
+ $return['module'] = $parts[4];
40
+ $return['className'] = str_replace('.php', '', implode('_', array_slice($parts, 3)));
41
+ $return['classPath'] = $parts[3] . '_' . $parts[4] . '_' . $parts[5];
42
+
43
+ return $return;
44
+ }
45
+
46
+ protected function _getGroupName($classpath, $module)
47
+ {
48
+ $helpers = $this->_getConfigHelpers();
49
+ $groups = array();
50
+ $classes = array();
51
+
52
+ foreach($helpers as $group => $helper) {
53
+ $groups[] = $group;
54
+ if($helper->class) {
55
+ $classes[] = $helper->class;
56
+ } else {
57
+ $classes[] = null;
58
+ }
59
+ }
60
+
61
+ if(($key = array_search($classpath, $classes))) {
62
+ return $groups[$key];
63
+ } else {
64
+ return strtolower($module);
65
+ }
66
+ }
67
+
68
+ protected function _getRewrite($groupName, $classAlias, $className)
69
+ {
70
+ $helpers = $this->_getConfigHelpers();
71
+
72
+ if(isset($helpers->{$groupName}->rewrite->{$classAlias})) {
73
+ if($className == (string) $helpers->{$groupName}->rewrite->{$classAlias}) {
74
+ if(isset($helpers->{$groupName}->class)) {
75
+ return array('for' => (string) $helpers->{$groupName}->class);
76
+ } else {
77
+ $return = array('for' => str_replace(' ', '_', ucwords('mage ' . $groupName . ' helper ' . $classAlias)));
78
+ }
79
+ } else {
80
+ $return = array('by' => (string) $helpers->{$groupName}->rewrite->{$classAlias});
81
+ }
82
+ return $return;
83
+ } else {
84
+ return array();
85
+ }
86
+ }
87
+
88
+ protected function _getConfigHelpers()
89
+ {
90
+ if(! $this->_configHelpers) {
91
+ $this->_configHelpers = new SimpleXMLElement(Mage::getConfig()->getNode('global/helpers')->asXML());
92
+ }
93
+
94
+ return $this->_configHelpers;
95
+ }
96
+
97
+ protected function _sortAll(&$classInfo, $sort)
98
+ {
99
+ $args = array(get_class($this), 'sortArrayAsc');
100
+ if($sort == 'desc') {
101
+ $args = array(get_class($this), 'sortArrayDesc');
102
+ }
103
+
104
+ usort($classInfo['methods']['own_methods'], $args);
105
+ foreach($classInfo['methods']['inherited'] as &$methods) {
106
+ usort($methods, $args);
107
+ }
108
+
109
+ usort($classInfo['properties']['own_props'], $args);
110
+ foreach($classInfo['properties']['inherited'] as &$props) {
111
+ usort($props, $args);
112
+ }
113
+
114
+ if($sort == 'desc') {
115
+ krsort($classInfo['constants']);
116
+ } else {
117
+ ksort($classInfo['constants']);
118
+ }
119
+ }
120
+
121
+ public static function sortArrayAsc($first, $second)
122
+ {
123
+ return strcmp($first['name'], $second['name']);
124
+ }
125
+
126
+ public static function sortArrayDesc($first, $second)
127
+ {
128
+ return -1 * strcmp($first['name'], $second['name']);
129
+ }
130
+ }
app/code/local/Alanstormdotcom/Developermanual/Model/Reflector/Helper.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Model_Reflector_Helper extends Mage_Core_Model_Abstract
3
+ {
4
+ protected $_reflector;
5
+ protected $_className;
6
+
7
+ public function __construct(array $args)
8
+ {
9
+ if( sizeof($args) != 2) {
10
+ throw new Exception('Wrong parameter count in ' . ___METHOD__);
11
+ }
12
+
13
+ $path = $args[0];
14
+ $this->_className = $args[1];
15
+
16
+ require_once($path);
17
+ $this->_reflector = new ReflectionClass($this->_className);
18
+ }
19
+
20
+ public function getParents()
21
+ {
22
+ $parents = array();
23
+ $class = $this->_reflector;
24
+
25
+ while($class = $class->getParentClass()) {
26
+ $parents[] = $class->getName();
27
+ }
28
+
29
+ return $parents;
30
+ }
31
+
32
+ public function getMethods(array $parents)
33
+ {
34
+ $return = array('own_methods' => array(),
35
+ 'inherited' => array());
36
+ foreach($parents as $parent) {
37
+ $return['inherited'][$parent] = array();
38
+ }
39
+
40
+ $methods = $this->_reflector->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC |
41
+ ReflectionMethod::IS_PROTECTED | ReflectionMethod::IS_FINAL);
42
+ foreach($methods as $method) {
43
+ $line = array();
44
+ $line['name'] = $method->name;
45
+ $line['fileName'] = $method->getFileName();
46
+ $line['modifiers'] = Reflection::getModifierNames($method->getModifiers());
47
+ $line['parameters'] = $this->_getParameters($method);
48
+ $line['docComment'] = $method->getDocComment();
49
+ $line['lineStart'] = $method->getStartLine();
50
+ $line['lineEnd'] = $method->getEndLine();
51
+ if($method->getDeclaringClass()->getName() == $this->_className) {
52
+ $return['own_methods'][] = $line;
53
+ } else{
54
+ $return['inherited'][$method->getDeclaringClass()->getName()][] = $line;
55
+ }
56
+ }
57
+
58
+ return $return;
59
+ }
60
+
61
+ public function getProperties(array $parents)
62
+ {
63
+ $return = array('own_props' => array(),
64
+ 'inherited' => array());
65
+ foreach($parents as $parent) {
66
+ $return['inherited'][$parent] = array();
67
+ }
68
+
69
+ foreach($this->_reflector->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED) as $prop) {
70
+ $line = array();
71
+ $line['name'] = $prop->getName();
72
+ $line['modifiers'] = Reflection::getModifierNames($prop->getModifiers());
73
+ $line['docComment'] = $prop->getDocComment();
74
+ $line['default'] = $this->_getDefaultValue($prop);
75
+ if($prop->getDeclaringClass()->getName() == $this->_className) {
76
+ $line['fileName'] = $this->_reflector->getFileName();
77
+ $return['own_props'][] = $line;
78
+ } else{
79
+ $class = new ReflectionClass($prop->getDeclaringClass()->getName());
80
+ $line['fileName'] = $class->getFileName();
81
+ $return['inherited'][$prop->getDeclaringClass()->getName()][] = $line;
82
+ }
83
+ }
84
+
85
+ return $return;
86
+ }
87
+
88
+ public function getConstants()
89
+ {
90
+ return $this->_reflector->getConstants();
91
+ }
92
+
93
+ public function getDocComment()
94
+ {
95
+ return $this->_reflector->getDocComment();
96
+ }
97
+
98
+ protected function _getParameters(Reflector $method)
99
+ {
100
+ $return = array();
101
+
102
+ foreach($method->getParameters() as $param) {
103
+ $line = array();
104
+ $line['name'] = $param->__toString();
105
+ if($param->isOptional()) {
106
+ $line['default'] = $param->getDefaultValue();
107
+ }
108
+
109
+ $return[] = $line;
110
+ }
111
+
112
+
113
+ return $return;
114
+ }
115
+
116
+ protected function _getDefaultValue(Reflector $prop)
117
+ {
118
+ if($prop->isProtected()) {
119
+ $prop->setAccessible(true);
120
+ }
121
+
122
+ if($prop->isStatic()) {
123
+ return $prop->getValue();
124
+ }
125
+
126
+ if(! $prop->getDeclaringClass()->isAbstract()) {
127
+ $className = $prop->getDeclaringClass()->getName();
128
+ $class = new $className();
129
+ return $prop->getValue($class);
130
+ }
131
+
132
+ return null;
133
+ }
134
+ }
app/code/local/Alanstormdotcom/Developermanual/Model/Source/Helper.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Model_Source_Helper extends Mage_Core_Model_Abstract
3
+ {
4
+ public function getCodePools()
5
+ {
6
+ return $this->_getDirs('app/code');
7
+ }
8
+
9
+ public function getNamespaces($codepool)
10
+ {
11
+ return $this->_getDirs($codepool);
12
+ }
13
+
14
+ public function getModules($namespace)
15
+ {
16
+ return $this->_getDirsContainingHelperDir($namespace);
17
+ }
18
+
19
+ public function getHelpers($module)
20
+ {
21
+ try {
22
+ $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($module . '/Helper'));
23
+ } catch (UnexpectedValueException $e) {
24
+ return '';
25
+ }
26
+
27
+ $options = array();
28
+ while($it->valid()) {
29
+ if (! $it->isDot()) {
30
+ $label = strtolower(str_replace('.php', '', str_replace('/', '_', $it->getSubPathName())));
31
+ $options[$it->key() . '=>' . $label] = $label;
32
+ }
33
+ $it->next();
34
+ }
35
+ return $this->_toOptionsFromHash($options);
36
+ }
37
+
38
+ protected function _getDirs($base)
39
+ {
40
+ try {
41
+ $it = new DirectoryIterator($base);
42
+ } catch (UnexpectedValueException $e) {
43
+ return '';
44
+ }
45
+
46
+ $dirs = array();
47
+ foreach ($it as $fileinfo) {
48
+ if(! $fileinfo->isDot() && $fileinfo->isDir()) {
49
+ $dirs[] = $fileinfo->getFilename();
50
+ }
51
+ }
52
+
53
+ return $this->_toOptionsFromArray($dirs, $base);
54
+ }
55
+
56
+ protected function _getDirsContainingHelperDir($base)
57
+ {
58
+ try {
59
+ $it = new DirectoryIterator($base);
60
+ } catch (UnexpectedValueException $e) {
61
+ return '';
62
+ }
63
+
64
+ $dirs = array();
65
+ foreach ($it as $fileinfo) {
66
+ if(! $fileinfo->isDot() && $fileinfo->isDir()) {
67
+ try {
68
+ $tmp = new DirectoryIterator($fileinfo->getPathName() . '/Helper');
69
+ } catch(UnexpectedValueException $e) {
70
+ continue;
71
+ }
72
+ $dirs[] = $fileinfo->getFilename();
73
+ }
74
+ }
75
+
76
+ return $this->_toOptionsFromArray($dirs, $base);
77
+ }
78
+
79
+ protected function _toOptionsFromArray(array $labels, $base, $addEmpty = true)
80
+ {
81
+ sort($labels);
82
+
83
+ $options = '';
84
+ if($addEmpty) {
85
+ $options .= '<option value="">Select...</option>';
86
+ }
87
+ foreach($labels as $label) {
88
+ $options .= '<option value="' . $base . '/' . $label . '">' . $label . '</option>';
89
+ }
90
+
91
+ return $options;
92
+ }
93
+
94
+ protected function _toOptionsFromHash($options)
95
+ {
96
+ ksort($options);
97
+
98
+ $return = '<option value="">Select...</option>';
99
+ foreach($options as $key => $value) {
100
+ $return .= '<option value="' . $key . '">' . $value . '</option>';
101
+ }
102
+
103
+ return $return;
104
+ }
105
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/Developermanual/ApiController.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Alanstormdotcom_Developermanual_ApiController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ protected function _initCssBlock()
5
+ {
6
+ $styles = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')->setTemplate('styles.phtml');
7
+ $this->_addJs($styles);
8
+ }
9
+
10
+ protected function _initSingleTemplateBlock()
11
+ {
12
+ $this->_initCssBlock();
13
+ $this->_addContent(
14
+ $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')
15
+ ->setTemplate($this->getFullActionName().'.phtml')
16
+ );
17
+ }
18
+
19
+ public function referenceAction()
20
+ {
21
+ $this->loadLayout();
22
+ $this->_initSingleTemplateBlock();
23
+ $this->renderLayout();
24
+ }
25
+
26
+ public function referenceAllAction()
27
+ {
28
+ $this->loadLayout();
29
+ $this->_initSingleTemplateBlock();
30
+ $this->renderLayout();
31
+ }
32
+
33
+ public function singleResourceAction()
34
+ {
35
+ $api = Mage::getSingleton('alanstormdotcom_developermanual/apiref');
36
+ $resource = $api->getResourceByName($this->getRequest()->getParam('resource'));
37
+
38
+ $block = $this->getLayout()->createBlock('alanstormdotcom_developermanual/apiresource');
39
+ $block->setResource($resource)
40
+ ->setShowMethod(true);
41
+ $this->getResponse()->setBody($block->toHtml());
42
+ }
43
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/Developermanual/HelperController.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Alanstormdotcom_Developermanual_HelperController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function helperReferenceAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_initCssJsBlock();
8
+ $block = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')
9
+ ->setTemplate('form_helper_action.phtml');
10
+ $this->_addContent($block);
11
+ $this->renderLayout();
12
+ }
13
+
14
+ public function namespacesAction()
15
+ {
16
+ $params = $this->getRequest()->getParams();
17
+ $codepool = $params['codepool'];
18
+
19
+ echo Mage::getModel('alanstormdotcom_developermanual/source_helper')->getNamespaces($codepool);
20
+ }
21
+
22
+ public function modulesAction()
23
+ {
24
+ $params = $this->getRequest()->getParams();
25
+ $namespace = $params['namespace'];
26
+
27
+ echo Mage::getModel('alanstormdotcom_developermanual/source_helper')->getModules($namespace);
28
+ }
29
+
30
+ public function helpersAction()
31
+ {
32
+ $params = $this->getRequest()->getParams();
33
+ $module = $params['module'];
34
+
35
+ echo Mage::getModel('alanstormdotcom_developermanual/source_helper')->getHelpers($module);
36
+ }
37
+
38
+ public function classinfoAction()
39
+ {
40
+ $param = $this->getRequest()->getParam('class');
41
+ $parts = explode('=>', $param);
42
+ $class = $parts[0];
43
+ $classAlias = $parts[1];
44
+
45
+ $sort = $this->getRequest()->getParam('sort');
46
+
47
+ $classInfo = Mage::getModel('alanstormdotcom_developermanual/helper')->getClassinfo($class, $classAlias, $sort);
48
+
49
+ $block = $this->getLayout()->createBlock('alanstormdotcom_developermanual/Renderer_Reflection_Helper')
50
+ ->setTemplate('ajax_helper_methods.phtml')
51
+ ->setClass($classInfo);
52
+
53
+ echo $block->toHtml();
54
+
55
+
56
+ }
57
+
58
+ protected function _initCssJsBlock()
59
+ {
60
+ $js = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')->setTemplate('helpers_js.phtml');
61
+ $this->_addJs($js);
62
+
63
+ $css = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')->setTemplate('helpers_css.phtml');
64
+ $this->_addJs($css);
65
+ }
66
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/Developermanual/IndexController.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Alanstormdotcom_Developermanual_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+
10
+ protected function _initCssBlock()
11
+ {
12
+ $styles = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')->setTemplate('styles.phtml');
13
+ $this->_addJs($styles);
14
+ }
15
+ protected function _initSingleTemplateBlock()
16
+ {
17
+ $this->_initCssBlock();
18
+ $this->_addContent(
19
+ $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')
20
+ ->setTemplate($this->getFullActionName().'.phtml')
21
+ );
22
+ }
23
+
24
+ public function aboutAction()
25
+ {
26
+ $this->loadLayout();
27
+ $this->_initSingleTemplateBlock();
28
+ $this->renderLayout();
29
+ }
30
+
31
+ public function blockLayoutactionsReferenceAction()
32
+ {
33
+ $this->loadLayout();
34
+ $this->_initCssBlock() ;
35
+
36
+ $block = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')
37
+ ->setTemplate('form_block_action.phtml');
38
+
39
+ $this->_addContent($block);
40
+ $this->renderLayout();
41
+ }
42
+
43
+ public function blockLayoutactionsReferenceAjaxAction()
44
+ {
45
+ $params = $this->getRequest()->getParams();
46
+ $alias = $params['alias'];
47
+
48
+ $info = Mage::helper('alanstormdotcom_developermanual/reflector')
49
+ ->getActionInformation($alias);
50
+
51
+ $this->loadLayout();
52
+
53
+ $results = $this->getLayout()
54
+ ->createBlock('alanstormdotcom_developermanual/renderer_reflection_action')
55
+ ->setEscapeXml(true)
56
+ ->setInfo($info)
57
+ ->setAlias($alias);
58
+
59
+ //$this->getLayout()->getBlock('content')->insert($results);
60
+
61
+ echo $results->toHtml();
62
+ // $this->renderLayout();
63
+ }
64
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/Alanstormdotcom/DevelopermanualController.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Alanstormdotcom_Developermanual_Alanstormdotcom_DevelopermanualController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function blockLayoutactionsReferenceAction()
5
+ {
6
+ var_dump(__METHOD__);
7
+ }
8
+
9
+ public function helperReferenceAction()
10
+ {
11
+ var_dump(__METHOD__);
12
+ }
13
+
14
+ public function apiReferenceAction()
15
+ {
16
+ var_dump(__METHOD__);
17
+ }
18
+
19
+ public function aboutAction()
20
+ {
21
+ var_dump(__METHOD__);
22
+ }
23
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/_ApiController.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ throw new Exception("Controller Moved to admin namespace, please update your references.");
3
+ /**
4
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+ class Alanstormdotcom_Developermanual_ApiController extends Mage_Adminhtml_Controller_Action
16
+ {
17
+ public function apiReferenceAction()
18
+ {
19
+ $this->loadLayout();
20
+ $this->renderLayout();
21
+ }
22
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/_HelperController.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ throw new Exception("Controller Moved to admin namespace, please update your references.");
3
+ class Alanstormdotcom_Developermanual_HelperController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ public function helperReferenceAction()
6
+ {
7
+ $this->loadLayout();
8
+ $this->_initCssJsBlock();
9
+ $block = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')
10
+ ->setTemplate('form_helper_action.phtml');
11
+ $this->_addContent($block);
12
+ $this->renderLayout();
13
+ }
14
+
15
+ public function namespacesAction()
16
+ {
17
+ $params = $this->getRequest()->getParams();
18
+ $codepool = $params['codepool'];
19
+
20
+ echo Mage::getModel('alanstormdotcom_developermanual/source_helper')->getNamespaces($codepool);
21
+ }
22
+
23
+ public function modulesAction()
24
+ {
25
+ $params = $this->getRequest()->getParams();
26
+ $namespace = $params['namespace'];
27
+
28
+ echo Mage::getModel('alanstormdotcom_developermanual/source_helper')->getModules($namespace);
29
+ }
30
+
31
+ public function helpersAction()
32
+ {
33
+ $params = $this->getRequest()->getParams();
34
+ $module = $params['module'];
35
+
36
+ echo Mage::getModel('alanstormdotcom_developermanual/source_helper')->getHelpers($module);
37
+ }
38
+
39
+ public function classinfoAction()
40
+ {
41
+ $param = $this->getRequest()->getParam('class');
42
+ $parts = explode('=>', $param);
43
+ $class = $parts[0];
44
+ $classAlias = $parts[1];
45
+
46
+ $sort = $this->getRequest()->getParam('sort');
47
+
48
+ $classInfo = Mage::getModel('alanstormdotcom_developermanual/helper')->getClassinfo($class, $classAlias, $sort);
49
+
50
+ $block = $this->getLayout()->createBlock('alanstormdotcom_developermanual/Renderer_Reflection_Helper')
51
+ ->setTemplate('ajax_helper_methods.phtml')
52
+ ->setClass($classInfo);
53
+
54
+ echo $block->toHtml();
55
+
56
+
57
+ }
58
+
59
+ protected function _initCssJsBlock()
60
+ {
61
+ $js = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')->setTemplate('helpers_js.phtml');
62
+ $this->_addJs($js);
63
+
64
+ $css = $this->getLayout()->createBlock('alanstormdotcom_developermanual/template')->setTemplate('helpers_css.phtml');
65
+ $this->_addJs($css);
66
+ }
67
+ }
app/code/local/Alanstormdotcom/Developermanual/controllers/{IndexController.php → _IndexController.php} RENAMED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Alanstormdotcom_Developermanual_IndexController extends Mage_Adminhtml_Controller_Action
3
  {
4
  public function indexAction()
1
  <?php
2
+ throw new Exception("Controller Moved to admin namespace, please update your references.");
3
+ /**
4
+ * Open Source Initiative OSI - The MIT License (MIT):Licensing
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2009 - 2011 Pulse Storm LLC
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
  class Alanstormdotcom_Developermanual_IndexController extends Mage_Adminhtml_Controller_Action
16
  {
17
  public function indexAction()
app/code/local/Alanstormdotcom/Developermanual/etc/adminhtml.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <menu>
3
+ <developermanual translate="title" module="alanstormdotcom_developermanual">
4
+ <title>Developer Manual</title>
5
+ <sort_order>9999</sort_order>
6
+ <children>
7
+ <block_actions module="alanstormdotcom_developermanual">
8
+ <title>Block Actions</title>
9
+ <!-- <action>adminhtml/alanstormdotcom_developermanual/blockLayoutactionsReference</action> -->
10
+ <action>adminhtml/alanstormdotcom_developermanual_index/blockLayoutactionsReference</action>
11
+ <!-- <action>developermanual/index/blockLayoutactionsReference</action> -->
12
+ </block_actions>
13
+
14
+ <helper_actions module="alanstormdotcom_developermanual">
15
+ <title>Helper Methods</title>
16
+ <action>adminhtml/alanstormdotcom_developermanual_helper/helperReference</action>
17
+ <!-- <action>adminhtml/alanstormdotcom_developermanual/helperReference</action> -->
18
+ <!-- <action>developermanual/helper/helperReference</action> -->
19
+ </helper_actions>
20
+
21
+ <magento_api module="alanstormdotcom_developermanual">
22
+ <title>Magento API</title>
23
+ <action>adminhtml/alanstormdotcom_developermanual_api/reference</action>
24
+ </magento_api>
25
+
26
+ <about module="alanstormdotcom_developermanual">
27
+ <title>About</title>
28
+ <action>adminhtml/alanstormdotcom_developermanual_index/about</action>
29
+ <!-- <action>developermanual/index/about</action> -->
30
+ </about>
31
+ </children>
32
+ </developermanual>
33
+ </menu>
34
+ </config>
app/code/local/Alanstormdotcom/Developermanual/etc/config.xml CHANGED
@@ -2,12 +2,19 @@
2
  <config>
3
  <modules>
4
  <Alanstormdotcom_Developermanual>
5
- <version>1.0.1</version>
6
  </Alanstormdotcom_Developermanual>
7
  </modules>
8
 
9
  <admin>
10
  <routers>
 
 
 
 
 
 
 
11
  <alanstormdotcom_developermanual>
12
  <use>admin</use>
13
  <args>
@@ -47,30 +54,4 @@
47
  </alanstormdotcom_developermanual>
48
  </helpers>
49
  </global>
50
-
51
-
52
- <adminhtml>
53
- <menu>
54
- <developermanual translate="title" module="alanstormdotcom_developermanual">
55
- <title>Developer Manual</title>
56
- <sort_order>9999</sort_order>
57
- <children>
58
- <block_actions module="alanstormdotcom_developermanual">
59
- <title>Block Actions</title>
60
- <action>developermanual/index/blockLayoutactionsReference</action>
61
- </block_actions>
62
-
63
- <about module="alanstormdotcom_developermanual">
64
- <title>Resources</title>
65
- <action>developermanual/index/resources</action>
66
- </about>
67
-
68
- <about module="alanstormdotcom_developermanual">
69
- <title>About</title>
70
- <action>developermanual/index/about</action>
71
- </about>
72
- </children>
73
- </developermanual>
74
- </menu>
75
- </adminhtml>
76
  </config>
2
  <config>
3
  <modules>
4
  <Alanstormdotcom_Developermanual>
5
+ <version>1.1.0</version>
6
  </Alanstormdotcom_Developermanual>
7
  </modules>
8
 
9
  <admin>
10
  <routers>
11
+ <adminhtml>
12
+ <args>
13
+ <modules>
14
+ <alanstormdotcom_developermanual before="Mage_Adminhtml">Alanstormdotcom_Developermanual</alanstormdotcom_developermanual>
15
+ </modules>
16
+ </args>
17
+ </adminhtml>
18
  <alanstormdotcom_developermanual>
19
  <use>admin</use>
20
  <args>
54
  </alanstormdotcom_developermanual>
55
  </helpers>
56
  </global>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  </config>
app/code/local/Alanstormdotcom/Developermanual/templates/adminhtml_alanstormdotcom_developermanual_api_reference.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $api = Mage::getSingleton('alanstormdotcom_developermanual/apiref');
3
+ $data = new stdClass();
4
+ $data->url = $this->getUrl('adminhtml/alanstormdotcom_developermanual_api/singleResource');
5
+ ?>
6
+ <h1>Magento API</h1>
7
+
8
+ <p>
9
+ <a href="<?php echo $this->getUrl('adminhtml/alanstormdotcom_developermanual_api/referenceAll');?>">View All</a>
10
+ |
11
+
12
+ <a href="<?php echo $this->getUrl('adminhtml/alanstormdotcom_developermanual_api/referenceAll',array('method'=>'1'));?>">View All With Implementation</a>
13
+ </p>
14
+
15
+ <h2>View Specific Resource</h2>
16
+
17
+ <form>
18
+ <select id="api_resource">
19
+ <option value="">-- select api resource --</option>
20
+ <?php foreach($api->getResourceNodes() as $resource): ?>
21
+ <option value="<?php echo $resource->getName();?>"><?php echo $resource->getName();?></option>
22
+ <?php endforeach; ?>
23
+ </select>
24
+ </form>
25
+ <div id="api_resource_results" style="margin-top:10px;">
26
+ </div>
27
+
28
+ <script type="text/javascript">
29
+ document.observe("dom:loaded", function() {
30
+ var data = <?php echo json_encode($data); ?>;
31
+ $('api_resource').observe('change',function(e){
32
+ var r = new Ajax.Request(data.url,{
33
+ method:'get',
34
+ parameters:{resource : $('api_resource').value},
35
+ onSuccess:function(r){
36
+ $('api_resource_results').update(r.responseText);
37
+ }
38
+ })
39
+ });
40
+ });
41
+ </script>
app/code/local/Alanstormdotcom/Developermanual/templates/adminhtml_alanstormdotcom_developermanual_api_referenceall.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1>Magento Core API</h1>
2
+ <?php
3
+ $config = Mage::getConfig()->loadModulesConfiguration('api.xml');
4
+ $api = $config->getNode('api');
5
+ $request = Mage::app()->getRequest();
6
+ ?>
7
+ <?php foreach($api->resources->children() as $resource): ?>
8
+ <h2>Resource: <?php echo $resource->getName();?></h2>
9
+ <?php
10
+ echo $this->getLayout()->createBlock('alanstormdotcom_developermanual/apiresource')
11
+ ->setResource($resource)
12
+ ->setShowMethod($request->getParam('method'))
13
+ ->toHtml();
14
+ ?>
15
+ <?php endforeach; ?>
app/code/local/Alanstormdotcom/Developermanual/templates/adminhtml_alanstormdotcom_developermanual_api_singleResource.phtml ADDED
File without changes
app/code/local/Alanstormdotcom/Developermanual/templates/{alanstormdotcom_developermanual_index_about.phtml → adminhtml_alanstormdotcom_developermanual_index_about.phtml} RENAMED
File without changes
app/code/local/Alanstormdotcom/Developermanual/templates/ajax_helper_methods.phtml ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $class = $this->getClass();
3
+ ?>
4
+ <table>
5
+ <tr>
6
+ <th class="label" colspan=2>
7
+ Class
8
+ </th>
9
+ </tr>
10
+ <tr>
11
+ <td class="label">
12
+ Class Name:
13
+ </td>
14
+ <td>
15
+ <?php echo $class['fileParts']['className']; ?>
16
+ </td>
17
+ </tr>
18
+ <tr>
19
+ <td class="label">
20
+ Parent(s):
21
+ </td>
22
+ <td>
23
+ <?php
24
+ if($class['parents']) {
25
+ echo implode(', ', $class['parents']);
26
+ }
27
+ ?>
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td class="label">
32
+ Implemented In:
33
+ </td>
34
+ <td>
35
+ <?php echo $class['filePath']; ?>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td class="label">
40
+ Factory Method:
41
+ </td>
42
+ <td>
43
+ <?php
44
+ $method = "Mage::helper('" . $class['groupName'];
45
+ if($class['alias'] != 'data') {
46
+ $method .= '/' . $class['alias'];
47
+ }
48
+ echo $method . "')";
49
+ ?>
50
+ </td>
51
+ </tr>
52
+ <?php if(is_array($class['rewrite']) && sizeof($class['rewrite']) > 0) : ?>
53
+ <tr>
54
+ <?php if(array_key_exists('by', $class['rewrite'])) : ?>
55
+ <td class="label">
56
+ Rewrite By:
57
+ </td>
58
+ <td>
59
+ <?php echo $class['rewrite']['by']; ?>
60
+ </td>
61
+ <?php elseif(array_key_exists('for', $class['rewrite'])) : ?>
62
+ <td class="label">
63
+ Rewrite For:
64
+ </td>
65
+ <td>
66
+ <?php echo $class['rewrite']['for']; ?>
67
+ </td>
68
+ <?php endif; ?>
69
+ </tr>
70
+ <?php endif; ?>
71
+ <tr>
72
+ <td class="label">
73
+ <a class="more" href="" onclick="return showIsHide('class_doc_comment');">Doc Comment:</a>
74
+ </td>
75
+ <td>
76
+ <span id="class_doc_comment" style="display: none;"><pre><?php echo $class['docComment']; ?></pre></span>
77
+ </td>
78
+ </tr>
79
+ </table>
80
+
81
+ <hr />
82
+
83
+ <table>
84
+ <tr>
85
+ <th class="label" colspan="2">
86
+ <a href="" class="more" onclick="return showIsHide('methods_body');">Methods</a>
87
+ </th>
88
+ </tr>
89
+ <tbody id="methods_body" style="display: '';">
90
+ <tr>
91
+ <td colspan="2">
92
+ <table>
93
+ <?php foreach($class['methods']['own_methods'] as $classMethod) : ?>
94
+ <tr>
95
+ <td class="tab">
96
+ &nbsp;
97
+ </td>
98
+ <td colspan="2">
99
+ <a href="" class="more" onclick="return moreIsLess('more_own_<?php echo $classMethod['name']; ?>', this)">more...</a>
100
+ </td>
101
+ <td>
102
+ <?php echo implode(' ', $classMethod['modifiers']); ?>
103
+ <?php echo $classMethod['name'] . $this->parseParameters($classMethod['parameters']); ?>
104
+ </td>
105
+ </tr>
106
+ <tbody id="more_own_<?php echo $classMethod['name']; ?>" style="display: none;">
107
+ <tr>
108
+ <td class="tab">
109
+ </td>
110
+ <td>
111
+ </td>
112
+ <td class="tab">
113
+ </td>
114
+ <td>
115
+ Implemented in: <?php echo $classMethod['fileName'] . ' on lines: ' . $classMethod['lineStart'] .
116
+ ' - ' . $classMethod['lineEnd']; ?>
117
+ </td>
118
+ </tr>
119
+ <tr>
120
+ <td class="tab">
121
+ </td>
122
+ <td>
123
+ </td>
124
+ <td class="tab">
125
+ </td>
126
+ <td>
127
+ <pre><?php echo $classMethod['docComment']; ?></pre>
128
+ </td>
129
+ </tr>
130
+ </tbody>
131
+ <?php endforeach; ?>
132
+ </table>
133
+ </td>
134
+ </tr>
135
+ <?php foreach($class['methods']['inherited'] as $name => $parentClass) : ?>
136
+ <tr>
137
+ <td style="width: 4px;">
138
+ &nbsp;
139
+ </td>
140
+ <td>
141
+ <table>
142
+ <tr>
143
+ <th colspan="3" class="label-small">
144
+ Inherited from: <a href="" class="more" onclick="return showIsHide('inherited_<?php echo $name; ?>');">
145
+ <?php echo $name; ?>
146
+ </a>
147
+ </th>
148
+ </tr>
149
+ <tbody id="inherited_<?php echo $name; ?>" style="display: none;">
150
+ <tr>
151
+ <td class="tab">
152
+ &nbsp;
153
+ </td>
154
+ <td>
155
+ <table>
156
+ <?php foreach($parentClass as $method) : ?>
157
+ <tr>
158
+ <td>
159
+ <a href="" class="more" onclick="return moreIsLess('more_inherited_<?php echo $method['name']; ?>', this)">more...</a>
160
+ </td>
161
+ <td>
162
+ <?php echo implode(' ', $method['modifiers']); ?>
163
+ <?php echo $method['name'] . $this->parseParameters($method['parameters']); ?>
164
+ </td>
165
+ </tr>
166
+ <tbody id ="more_inherited_<?php echo $method['name']; ?>" style="display: none;">
167
+ <tr>
168
+ <td>
169
+ </td>
170
+ <td>
171
+ Implemented in: <?php echo $method['fileName'] . ' on lines: ' . $method['lineStart'] .
172
+ ' - ' . $method['lineEnd']; ?>
173
+ </td>
174
+ </tr>
175
+ <tr>
176
+ <td>
177
+ </td>
178
+ <td>
179
+ <pre><?php echo $method['docComment']; ?></pre>
180
+ </td>
181
+ </tr>
182
+ </tbody>
183
+ <?php endforeach; ?>
184
+ </table>
185
+ </td>
186
+ </tr>
187
+ </tbody>
188
+ </table>
189
+ </td>
190
+ </tr>
191
+ <?php endforeach; ?>
192
+ </tbody>
193
+ </table>
194
+
195
+ <table>
196
+ <tr>
197
+ <th class="label" colspan="2">
198
+ <a href="" class="more" onclick="return showIsHide('constants_body');">Constants</a>
199
+ </th>
200
+ </tr>
201
+ <tbody id="constants_body" style="display: '';">
202
+ <?php foreach($class['constants'] as $constant => $value) : ?>
203
+ <tr>
204
+ <td class="tab">
205
+ &nbsp;
206
+ </td>
207
+ <td>
208
+ <?php echo $constant . ' = ' . $value; ?>
209
+ </td>
210
+ </tr>
211
+ <?php endforeach; ?>
212
+ </tbody>
213
+ </table>
214
+
215
+ <table>
216
+ <tr>
217
+ <th class="label" colspan="2">
218
+ <a class="more" href="" onclick="return showIsHide('props_body');">Properties</a>
219
+ </th>
220
+ </tr>
221
+ <tbody id="props_body" style="display: '';">
222
+ <tr>
223
+ <td colspan="2">
224
+ <table>
225
+ <?php foreach($class['properties']['own_props'] as $classProp) : ?>
226
+ <tr>
227
+ <td class="tab">
228
+ &nbsp;
229
+ </td>
230
+ <td colspan="2">
231
+ <a href="" class="more" onclick="return moreIsLess('more_own_prop<?php echo $classProp['name']; ?>', this)">more...</a>
232
+ </td>
233
+ <td>
234
+ <?php echo implode(' ', $classProp['modifiers']); ?>
235
+ <?php echo $classProp['name']; ?>
236
+ <?php if($classProp['default']) echo ' = ' . $classProp['default']; ?>
237
+ </td>
238
+ </tr>
239
+ <tbody id="more_own_prop<?php echo $classProp['name']; ?>" style="display: none;">
240
+ <tr>
241
+ <td class="tab">
242
+ </td>
243
+ <td>
244
+ </td>
245
+ <td class="tab">
246
+ </td>
247
+ <td>
248
+ Implemented in: <?php echo $classProp['fileName']; ?>
249
+ </td>
250
+ </tr>
251
+ <tr>
252
+ <td class="tab">
253
+ </td>
254
+ <td>
255
+ </td>
256
+ <td class="tab">
257
+ </td>
258
+ <td>
259
+ <pre><?php echo $classProp['docComment']; ?></pre>
260
+ </td>
261
+ </tr>
262
+ </tbody>
263
+ <?php endforeach; ?>
264
+ </table>
265
+ </td>
266
+ </tr>
267
+ <?php foreach($class['properties']['inherited'] as $name => $parentClass) : ?>
268
+ <tr>
269
+ <td class="tab">
270
+ &nbsp;
271
+ </td>
272
+ <td>
273
+ <table>
274
+ <tr>
275
+ <th colspan="3" class="label-small">
276
+ Inherited from: <a href="" class="more" onclick="return showIsHide('inherited_prop<?php echo $name; ?>');">
277
+ <?php echo $name; ?>
278
+ </a>
279
+ </th>
280
+ </tr>
281
+ <tbody id="inherited_prop<?php echo $name; ?>" style="display: none;">
282
+ <tr>
283
+ <td class="tab">
284
+ &nbsp;
285
+ </td>
286
+ <td>
287
+ <table>
288
+ <?php foreach($parentClass as $prop) : ?>
289
+ <tr>
290
+ <td>
291
+ <a href="" class="more" onclick="return moreIsLess('more_inherited_props<?php echo $prop['name']; ?>', this)">more...</a>
292
+ </td>
293
+ <td>
294
+ <?php echo implode(' ', $prop['modifiers']); ?>
295
+ <?php echo $prop['name']; ?>
296
+ </td>
297
+ </tr>
298
+ <tbody id ="more_inherited_props<?php echo $prop['name']; ?>" style="display: none;">
299
+ <tr>
300
+ <td>
301
+ </td>
302
+ <td>
303
+ Implemented in: <?php echo $prop['fileName']; ?>
304
+ </td>
305
+ </tr>
306
+ <tr>
307
+ <td>
308
+ </td>
309
+ <td>
310
+ <pre><?php echo $prop['docComment']; ?></pre>
311
+ </td>
312
+ </tr>
313
+ </tbody>
314
+ <?php endforeach; ?>
315
+ </table>
316
+ </td>
317
+ </tr>
318
+ </tbody>
319
+ </table>
320
+ </td>
321
+ </tr>
322
+ <?php endforeach; ?>
323
+ </tbody>
324
+ </table>
325
+
326
+ <hr />
app/code/local/Alanstormdotcom/Developermanual/templates/api_resource.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $resource = $this->getResource(); ?>
2
+ <?php $model = Mage::getModel($resource->model); ?>
3
+ <?php foreach($resource->methods->children() as $method): ?>
4
+ <h3>Method: <?php echo $method->getName();?></h3>
5
+ <?php $php_method = $method->method ? $method->method : $method->getName(); ?>
6
+ <?php $reflection = new ReflectionMethod($model,$php_method); ?>
7
+ <p>
8
+ <code>$client->call($sessionId<?php
9
+ echo ", " . "'" . $resource->getName() . '.' . $method->getName() . "'";
10
+ foreach($reflection->getParameters() as $param)
11
+ {
12
+ echo ', $' . $param->getName();
13
+ }
14
+ ?>);</code>
15
+ </p>
16
+
17
+ <h4>Implemented In</h4>
18
+ <p>
19
+ <code>
20
+ <?php echo get_class($model),'::',$php_method,"<br />"; ?>
21
+ <?php echo $reflection->getFilename(); ?>
22
+ </code>
23
+ </p>
24
+ <h4>Doc Comment</h4>
25
+ <pre><?php echo preg_replace('{ \*}','*',$reflection->getDocComment()); ?></pre>
26
+
27
+ <?php if($this->getShowMethod()): ?>
28
+ <h4>Method Implementation Definition</h4>
29
+ <pre><?php
30
+ $lines = file($reflection->getFilename());
31
+ $lines = array_slice($lines,
32
+ $reflection->getStartLine()-1,
33
+ $reflection->getEndLine() - $reflection->getStartLine() + 1
34
+ );
35
+ echo htmlspecialchars(implode("",$lines));
36
+ ?>
37
+ </pre>
38
+ <?php endif; ?>
39
+
40
+ <?php endforeach; ?>
app/code/local/Alanstormdotcom/Developermanual/templates/form_block_action.phtml CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $url_action = Mage::getModel('adminhtml/url')->getUrl('*/index/blockLayoutactionsReferenceAjax');
3
  ?>
4
  <h1>Block Action Reference</h1>
5
 
1
  <?php
2
+ $url_action = Mage::getModel('adminhtml/url')->getUrl('*/*/blockLayoutactionsReferenceAjax');
3
  ?>
4
  <h1>Block Action Reference</h1>
5
 
app/code/local/Alanstormdotcom/Developermanual/templates/form_helper_action.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $model = Mage::getModel('alanstormdotcom_developermanual/source_helper');
3
+ $codePoolOptions = $model->getCodePools();
4
+ ?>
5
+ <h1>Helper Methods Reference</h1>
6
+ <div id="selects">
7
+ <span class="select">
8
+ <div class="label">CodePool</div>
9
+ <div>
10
+ <select id="codepool_select">
11
+ <?php echo $codePoolOptions; ?>
12
+ </select>
13
+ </div>
14
+ </span>
15
+ <span id="namespace_span" class="select" style="display: none;">
16
+ <div class="label">NameSpace</div>
17
+ <div>
18
+ <select id="namespace_select">
19
+
20
+ </select>
21
+ </div>
22
+ </span>
23
+ <span id="module_span" class="select" style="display: none;">
24
+ <div class="label">Module</div>
25
+ <div>
26
+ <select id="module_select"></select>
27
+ </div>
28
+ </span>
29
+ <span id="helper_span" class="select" style="display: none;">
30
+ <span class="select">
31
+ <div class="label">Helper</div>
32
+ <div>
33
+ <select id="helper_select"></select>
34
+ </div>
35
+ </span>
36
+ <span class="select">
37
+ <div class="label">Sort</div>
38
+ <div>
39
+ <select id="sort_select">
40
+ <option value="">Don't sort</option>
41
+ <option value="asc">Sort ascending</option>
42
+ <option value="desc">Sort descending</option>
43
+ </select>
44
+ </div>
45
+ </span>
46
+ </span>
47
+ </div>
48
+ <div class="clear"></div>
49
+ <hr />
50
+ <div id="result">
51
+
52
+ </div>
53
+
54
+
app/code/local/Alanstormdotcom/Developermanual/templates/helpers_css.phtml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+ hr {
3
+ margin-bottom: 6px;
4
+ margin-top: 12px;
5
+ }
6
+
7
+ table {
8
+ border: 0;
9
+ border-collapse: collapse;
10
+ margin-top: 8px;
11
+ }
12
+
13
+ td {
14
+ margin: 4px;
15
+ padding: 4px;
16
+ }
17
+
18
+ td.tab {
19
+ width: 4px;
20
+ }
21
+
22
+ a.more {
23
+ color: #666666;
24
+ }
25
+
26
+ th.label {
27
+ font-size: 1.6em;
28
+ }
29
+
30
+ th.label-small {
31
+ font-size: 1.2em;
32
+ }
33
+
34
+ td.label {
35
+ font-weight: bold;
36
+ }
37
+
38
+ span.select {
39
+ float: left;
40
+ margin-right: 8px;
41
+ }
42
+
43
+ div.label {
44
+ font-weight: bold;
45
+ }
46
+
47
+ .clear {
48
+ clear: both;
49
+ }
50
+ </style>
app/code/local/Alanstormdotcom/Developermanual/templates/helpers_js.phtml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $urlNamespace = Mage::getModel('adminhtml/url')->getUrl('*/*/namespaces');
3
+ $urlModule = Mage::getModel('adminhtml/url')->getUrl('*/*/modules');
4
+ $urlHelper = Mage::getModel('adminhtml/url')->getUrl('*/*/helpers');
5
+ $urlClassInfo = Mage::getModel('adminhtml/url')->getUrl('*/*/classinfo');
6
+ ?>
7
+ <script type="text/javascript">
8
+ document.observe("dom:loaded", function() {
9
+ $('codepool_select').observe('change',function(e){
10
+ if($('codepool_select').value) {
11
+ var r = new Ajax.Request('<?php echo $urlNamespace; ?>',{
12
+ method:'get',
13
+ parameters:{codepool : $('codepool_select').value},
14
+ onSuccess:function(r){
15
+ $('namespace_select').innerHTML = r.responseText;
16
+ $('namespace_span').show();
17
+ $('module_span').hide();
18
+ $('helper_span').hide();
19
+ }
20
+ })
21
+ }
22
+ });
23
+
24
+ $('namespace_select').observe('change',function(e){
25
+ if($('namespace_select').value) {
26
+ var r = new Ajax.Request('<?php echo $urlModule; ?>',{
27
+ method:'get',
28
+ parameters:{namespace : $('namespace_select').value},
29
+ onSuccess:function(r){
30
+ $('module_select').innerHTML = r.responseText;
31
+ $('module_span').show();
32
+ $('helper_span').hide();
33
+ }
34
+ })
35
+ }
36
+ });
37
+
38
+ $('module_select').observe('change',function(e){
39
+ if($('module_select').value) {
40
+ var r = new Ajax.Request('<?php echo $urlHelper; ?>',{
41
+ method:'get',
42
+ parameters:{module : $('module_select').value},
43
+ onSuccess:function(r){
44
+ $('helper_select').innerHTML = r.responseText;
45
+ $('helper_span').style.display = '';
46
+ }
47
+ })
48
+ }
49
+ });
50
+
51
+ $('helper_select').observe('change', function(e){
52
+ if($('helper_select').value) {
53
+ var r = new Ajax.Request('<?php echo $urlClassInfo; ?>',{
54
+ method:'get',
55
+ parameters:{class : $('helper_select').value,
56
+ sort : $('sort_select').value},
57
+ onSuccess:function(r){
58
+ $('result').innerHTML = r.responseText;
59
+ }
60
+ })
61
+ }
62
+ });
63
+
64
+ $('sort_select').observe('change', function(e){
65
+ if($('helper_select').value) {
66
+ var r = new Ajax.Request('<?php echo $urlClassInfo; ?>',{
67
+ method:'get',
68
+ parameters:{class : $('helper_select').value,
69
+ sort : $('sort_select').value},
70
+ onSuccess:function(r){
71
+ $('result').innerHTML = r.responseText;
72
+ }
73
+ })
74
+ }
75
+ });
76
+
77
+ showIsHide = function(el)
78
+ {
79
+ $(el).toggle();
80
+ return false;
81
+ };
82
+
83
+ moreIsLess = function(el, caller)
84
+ {
85
+ $(el).toggle();
86
+ $(caller).innerHTML == 'more...' ? $(caller).innerHTML = 'less...' : $(caller).innerHTML = 'more...';
87
+ return false;
88
+ };
89
+ });
90
+ </script>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Developer_Manual</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>MIT License</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>An extension with interactive reference material for Magento Developers.</description>
11
  <notes>No Notes</notes>
12
  <authors><author><name>Alan Storm</name><user>auto-converted</user><email>astorm@alanstorm.com</email></author></authors>
13
- <date>2011-12-06</date>
14
- <time>21:51:35</time>
15
- <contents><target name="magelocal"><dir name="Alanstormdotcom"><dir name="Developermanual"><dir name="Block"><dir name="Renderer"><dir name="Reflection"><file name="Action.php" hash="3eaf6ed2a2bf36171ec59a7a9f5cb07c"/></dir></dir><file name="Abstractref.php" hash="0252c97581fbefaf7bd9ac44f242d1bb"/><file name="Template.php" hash="dd17ea3507d90b09a3b4783f585c2724"/></dir><dir name="Helper"><file name="Data.php" hash="3002a72a0b860164f8e56c58b3967d56"/><file name="Reflector.php" hash="78807cce56fe7f2e6dc16ab8fe33d403"/><file name="Xmlpp.php" hash="a3e8a5af37d6efd2da0a8092e7f34f28"/></dir><dir name="controllers"><file name="IndexController.php" hash="72c713f510d770c1b26662a537d3d5a7"/></dir><dir name="etc"><file name="config.xml" hash="630e328b72a9009998cf468bc2b64f54"/></dir><dir name="templates"><file name="alanstormdotcom_developermanual_index_about.phtml" hash="edc31d1bfd4e4e48c2b46196f668836b"/><file name="form_block_action.phtml" hash="8e92e7690fa28512a4d5eacdb6dddac2"/><file name="styles.phtml" hash="14b57ccacff83bffbf8ac874973ce976"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Alanstormdotcom_Developermanual.xml" hash="384dde044552eca2f0f7fad4889236c9"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Developer_Manual</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>MIT License</license>
7
  <channel>community</channel>
10
  <description>An extension with interactive reference material for Magento Developers.</description>
11
  <notes>No Notes</notes>
12
  <authors><author><name>Alan Storm</name><user>auto-converted</user><email>astorm@alanstorm.com</email></author></authors>
13
+ <date>2012-01-02</date>
14
+ <time>21:53:17</time>
15
+ <contents><target name="magelocal"><dir name="Alanstormdotcom"><dir name="Developermanual"><dir name="Block"><dir name="Renderer"><dir name="Reflection"><file name="Action.php" hash="f73121603ec5720a53cedf3e612b4600"/><file name="Api.php" hash="a77b2d2b71cb8b9765f497452d1b0432"/><file name="Helper.php" hash="a463ab37aa2590e4753e48f92bd8fcf3"/></dir></dir><file name="Abstractref.php" hash="420c8f44135cd71da179899d7565be0e"/><file name="Apiresource.php" hash="04b74fa800105972aaea64c979aa3365"/><file name="Template.php" hash="0f777a48b45d8c797a48ecb37a1b9d5f"/></dir><dir name="Helper"><file name="Data.php" hash="fd738aa5536eee860e122bdef90244f3"/><file name="Reflector.php" hash="7b64140831adc4ea29376625e2638785"/><file name="Xmlpp.php" hash="0bdc0fb1d4774e2c2bc955839ce2fe4e"/></dir><dir name="Model"><dir name="Reflector"><file name="Helper.php" hash="c35824e0dd5b80798cd2dc435114bff4"/></dir><dir name="Source"><file name="Helper.php" hash="9a85b1236a17f04a0afd75f8dcf8f3ce"/></dir><file name="Apiref.php" hash="d48419aae0bea744d9aa6e6b5ef91eda"/><file name="Helper.php" hash="1e1d27ad7c003072a71612d3699d21f2"/></dir><dir name="controllers"><dir name="Alanstormdotcom"><dir name="Developermanual"><file name="ApiController.php" hash="7a5c1787c065a2a9c29a0226b2309b7c"/><file name="HelperController.php" hash="b9f55a67390be1c99e033af44e1b09a6"/><file name="IndexController.php" hash="3e9427eb0d026a65951d3b3df7b9a93a"/></dir><file name="DevelopermanualController.php" hash="ac2cb91a2e4f29b5990c19945fbe622d"/></dir><file name="_ApiController.php" hash="ec2cc01f069674d9f23b035f0d6ecbcb"/><file name="_HelperController.php" hash="0736ea7056c9a29b6290595efa01e831"/><file name="_IndexController.php" hash="416c122f2c521e0115219d2ad34d7281"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c2ac8d4041f0a0c97b38223a70b47adb"/><file name="config.xml" hash="d230ec8f1092c46f740fd6ef0fb6d036"/></dir><dir name="templates"><file name="adminhtml_alanstormdotcom_developermanual_api_reference.phtml" hash="22a9c79778d532ce9fdd8716ab762b73"/><file name="adminhtml_alanstormdotcom_developermanual_api_referenceall.phtml" hash="c920ade9a5937f690c2517969ae9da82"/><file name="adminhtml_alanstormdotcom_developermanual_api_singleResource.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="adminhtml_alanstormdotcom_developermanual_index_about.phtml" hash="edc31d1bfd4e4e48c2b46196f668836b"/><file name="ajax_helper_methods.phtml" hash="f6ae7dff9b4804e11291aafe6135467f"/><file name="api_resource.phtml" hash="ac1d349555fd33475e9ce937bdb8fa4c"/><file name="form_block_action.phtml" hash="71ba869900ed60c27ef749804bea6d7e"/><file name="form_helper_action.phtml" hash="86f6215e9fc24d5a6775880bb7d0d0fc"/><file name="helpers_css.phtml" hash="e46748f15f888f14b9af65dee4009331"/><file name="helpers_js.phtml" hash="aefec7f902b5c9e4c46c78987b65bcbd"/><file name="styles.phtml" hash="14b57ccacff83bffbf8ac874973ce976"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Alanstormdotcom_Developermanual.xml" hash="384dde044552eca2f0f7fad4889236c9"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>