Okay hi guys I'm back, Tha
nks for all the help you have provided, it is so so helpful. Thanks. So I went back to the documents on the modx rtfm (
http://rtfm.modx.com/revolution/2.x/case-studies-and-tutorials/developing-an-extra-in-modx-revolution) and found that thy had been updated. Not sure if that was one of you guys or someone else but who ever it was changed things up a bit. So I put in all the needed code and I think I am starting to get some where. I got some very neat messages when I regenerated the class files and maps with the new code. That went very well.. although i did get a error code
"Could not load class: SlideDat from mysql.slidedat."
I have gone through my code and seen lots of places where I made uppercase SlideDat and lowercase slideDat for the code like:
$slideD = $modx->getService('slideDat','SlideDat',$modx->getOption('slideDat.core_path',null,$modx->getOption('core_path').'components/slideDat/').'model/slideDat/',$scriptProperties);
I thought that since the doodles snippet had upercase and lowercase names I would place mine the same way...So my thoughts are that I may have mixed the uppercase and lower case name slideDat around... Here is my code, if any of you can help that would be great!
build.config.php:
<?php
/**
* Define the MODX path constants necessary for installation
*
* @package slideDat
* @subpackage build
*/
define('MODX_BASE_PATH', 'C:/Program Files (x86)/EasyPHP-DevServer-14.1VC11/data/localweb/modx/');
define('MODX_CORE_PATH', MODX_BASE_PATH . 'core/');
define('MODX_MANAGER_PATH', MODX_BASE_PATH . 'manager/');
define('MODX_CONNECTORS_PATH', MODX_BASE_PATH . 'connectors/');
define('MODX_ASSETS_PATH', MODX_BASE_PATH . 'assets/');
define('MODX_BASE_URL','/modx/');
define('MODX_CORE_URL', MODX_BASE_URL . 'core/');
define('MODX_MANAGER_URL', MODX_BASE_URL . 'manager/');
define('MODX_CONNECTORS_URL', MODX_BASE_URL . 'connectors/');
define('MODX_ASSETS_URL', MODX_BASE_URL . 'assets/');
snippet.slideDat.php:
<?php
* @package slideDat
*/
$slideD = $modx->getService('slideDat','SlideDat',$modx->getOption('slideDat.core_path',null,$modx->getOption('core_path').'components/slideDat/').'model/slideDat/',$scriptProperties);
if (!($slideD instanceof SlideDat)) return '';
/* setup default properties */
$tpl = $modx->getOption('tpl',$scriptProperties,'rowTpl');
$sort = $modx->getOption('sort',$scriptProperties,'name');
$dir = $modx->getOption('dir',$scriptProperties,'ASC');
$output = '';
$slidedat = $modx->getCollection('SlideDat');
$output = count($slidedat);
return $output;
build.schema.php:
<?php
require_once 'C:/Program Files (x86)/EasyPHP-DevServer-14.1VC11/data/localweb/slideDat/_build/build.config.php';
include_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx= new modX();
$modx->initialize('mgr');
$modx->loadClass('transport.modPackageBuilder','',false, true);
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$sources = array(
'model' => $modx->getOption('slideDat.core_path').'model/',
'schema_file' => $modx->getOption('slideDat.core_path').'model/schema/slideDat.mysql.schema.xml'
);
$manager= $modx->getManager();
$generator= $manager->getGenerator();
if (!is_dir($sources['model'])) { $modx->log(modX::LOG_LEVEL_ERROR,'Model directory not found!'); die(); }
if (!file_exists($sources['schema_file'])) { $modx->log(modX::LOG_LEVEL_ERROR,'Schema file not found!'); die(); }
$generator->parseSchema($sources['schema_file'],$sources['model']);
$modx->addPackage('slideDat', $sources['model']); // add package to make all models available
$manager->createObjectContainer('SlideDat'); // created the database table
$modx->log(modX::LOG_LEVEL_INFO, 'Done!');
slideDat.class.php:
<?php
/**
* @package -extra names
*/
class SlideDat {
/**
* Constructs the -extra names object
*
* @param modX &$modx A reference to the modX object
* @param array $config An array of configuration options
*/
function __construct(modX &$modx,array $config = array()) {
$this->modx =& $modx;
$basePath = $this->modx->getOption('slideDat.core_path',$config,$this->modx->getOption('core_path').'components/slideDat/');
$assetsUrl = $this->modx->getOption('slideDat.assets_url',$config,$this->modx->getOption('assets_url').'components/slideDat/');
$this->config = array_merge(array(
'basePath' => $basePath,
'corePath' => $basePath,
'modelPath' => $basePath.'model/',
'processorsPath' => $basePath.'processors/',
'templatesPath' => $basePath.'templates/',
'chunksPath' => $basePath.'elements/chunks/',
'jsUrl' => $assetsUrl.'js/',
'cssUrl' => $assetsUrl.'css/',
'assetsUrl' => $assetsUrl,
'connectorUrl' => $assetsUrl.'connector.php',
),$config);
}
$this->$modx->addPackage('slideDat',$this->config['modelPath']);
}
Thank you all so very much and my apologies If I am taking from your time to often. I do not wish to appear lazy or someone who just wants everyone else to do the work. I am really trying but I just need some helpful guidance. I really wish to contribute to the community and do my part.
Thank you all,
ModxNooby