-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,450 additions
and
193 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
{ | ||
"name": "mzeis/mzeis_documentation", | ||
"type": "magento-module", | ||
"license": "MIT", | ||
"description": "Create a documentation for your project in the backend.", | ||
"authors": [ | ||
{ | ||
"name": "Matthias Zeis", | ||
"homepage": "http://matthias-zeis.com" | ||
} | ||
] | ||
"name": "mzeis/mzeis_documentation", | ||
"type": "magento-module", | ||
"require": { | ||
"erusev/parsedown": "1.6.0" | ||
}, | ||
"license": "MIT", | ||
"description": "Create a documentation for your project in the backend.", | ||
"authors": [ | ||
{ | ||
"name": "Matthias Zeis", | ||
"homepage": "http://matthias-zeis.com" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/app/code/community/Mzeis/Documentation/Helper/Module.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
class Mzeis_Documentation_Helper_Module extends Mage_Core_Helper_Abstract | ||
{ | ||
/** | ||
* @param string $name Module name | ||
* @return bool True if it is an active, existing module | ||
*/ | ||
public function isActiveModule($name) | ||
{ | ||
return !is_null(Mage::getResourceSingleton('mzeis_documentation/module_collection')->getItemByColumnValue('name', $name)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/app/code/community/Mzeis/Documentation/Helper/Page/File.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
class Mzeis_Documentation_Helper_Page_File extends Mage_Core_Helper_Abstract | ||
{ | ||
/** | ||
* Returns the allowed extensions for page files. | ||
* | ||
* @return array | ||
*/ | ||
public function getAllowedExtensions() | ||
{ | ||
return array('md', 'markdown'); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/app/code/community/Mzeis/Documentation/Model/Module.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/** | ||
* @method string getName() | ||
* @method setName(string $value) | ||
*/ | ||
class Mzeis_Documentation_Model_Module extends Varien_Object | ||
{ | ||
/** | ||
* @var Mzeis_Documentation_Model_Resource_Module_Page_Collection | ||
*/ | ||
protected $_pageCollection = null; | ||
|
||
/** | ||
* Returns the URL to the overview page of the module. | ||
* | ||
* @return string | ||
*/ | ||
public function getOverviewUrl() | ||
{ | ||
return Mage::helper("adminhtml")->getUrl('adminhtml/mzeis_documentation_module/view', array('module' => $this->getName())); | ||
} | ||
|
||
/** | ||
* @return Mzeis_Documentation_Model_Resource_Module_File_Collection | ||
*/ | ||
public function getPageCollection() | ||
{ | ||
if (is_null($this->_pageCollection)) { | ||
$this->_pageCollection = Mage::getResourceModel('mzeis_documentation/page_collection'); | ||
$this->_pageCollection->addModuleFilter($this->getName()); | ||
} | ||
|
||
return $this->_pageCollection; | ||
} | ||
|
||
/** | ||
* Returns the URL to a specific page of the module. | ||
* | ||
* @param string $page | ||
* @return string | ||
*/ | ||
public function getPageUrl($page) | ||
{ | ||
return Mage::helper('adminhtml')->getUrl('adminhtml/mzeis_documentation/view', array('_query' => array('page' => $page, 'module' => $this->getName()))); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.