From dcdbeedd6316763591d5783b5726f04e67093ac6 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 13 Jul 2015 09:22:29 -0400 Subject: [PATCH] Code Comments Go through the code and make method Documentation. --- controllers/Import.php | 111 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/controllers/Import.php b/controllers/Import.php index b72e8b8..4d247bd 100644 --- a/controllers/Import.php +++ b/controllers/Import.php @@ -40,6 +40,17 @@ } if (class_exists('WP_Importer')) { + + /** + * Toolbox_Import + * + * @uses WP_Importer + * @package Webdav + * @version //autogen// + * @copyright Copyright (c) 2010 All rights reserved. + * @author Steve Sutton + * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt} + */ class Toolbox_Import extends WP_Importer { private $_dbh; @@ -47,17 +58,39 @@ private $_options; + /** + * __construct + * + * @access public + * @return void + */ public function __construct() { $this->_getOptions(); } + /** + * _getOptions + * + * Retrieve the Import options + * + * @access private + * @return void + */ private function _getOptions() { // read options for the import and if they aren't set then give a warning. $this->_options = get_option(GLM_WP_IMPORT_SETTINGS); } + /** + * _connect + * + * Connect to the Toolbox Database + * + * @access private + * @return void + */ private function _connect() { if ($this->_dbh) { @@ -77,17 +110,42 @@ ); } + /** + * _header + * + * Build Admin Page Header + * + * @access private + * @return void + */ private function _header() { echo '
'; echo '

'.__('Toolbox Importer').'

'; } + /* private _footer() {{{ */ + /** + * _footer + * + * Build Admin Page Footer + * + * @access private + * @return void + */ private function _footer() { echo '
'; } + /** + * _checkRequiredOptions + * + * Verifies that important settings aren't empty + * + * @access private + * @return void + */ private function _checkRequiredOptions() { $errors = array(); @@ -118,6 +176,16 @@ return $errors; } + /** + * _greet + * + * Greet Screen when you first goto the Toolbox Import + * Runs checks on the settings. + * Won't allow you to pass unless all is O.K. + * + * @access private + * @return void + */ private function _greet() { // Verify that everything is setup @@ -138,6 +206,16 @@ } } + /** + * _displayImage + * + * Build the HTML code for the Images + * + * @param mixed $data + * @param mixed $alignment + * @access private + * @return void + */ private function _displayImage($data, $alignment) { if ($data['caption']) { @@ -152,6 +230,14 @@ return $content; } + /** + * _fetchAllPages + * + * Fetch all the toolbox pages + * + * @access private + * @return void + */ private function _fetchAllPages() { $this->_connect(); @@ -244,11 +330,27 @@ return $data; } + /** + * _readOptions + * + * Display all Import options + * + * @access private + * @return void + */ private function _readOptions() { var_dump($this->_options); } + /** + * _import + * + * Handles the page import + * + * @access private + * @return void + */ private function _import() { echo '

Fetching Pages

'; @@ -274,6 +376,15 @@ var_dump($pages); } + /** + * dispatch + * + * Dispatch Funcion. + * Checks which step admin user is on and calls appropriate methods. + * + * @access public + * @return void + */ public function dispatch() { $this->_header(); -- 2.17.1