Example #1
0
 * for basic usage.
 *
 * @package eventscalendar2
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'eventscalendar2.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'eventscalendar2.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'eventscalendar2');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/eventscalendar2/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/eventscalendar2/');
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/eventscalendar2/');
            break;
    }
}
return true;
Example #2
0
 * for basic usage.
 *
 * @package Formz
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'formz.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'formz.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'formz');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/formz/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/formz/');
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/formz/');
            break;
    }
}
return true;
/**
 * Resolve settings.
 *
 * @package ajaxfileupload
 * @subpackage build
 */
function createSetting(&$modx, $key, $value, $type = 'textfield')
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'ajaxfileupload.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'ajaxfileupload.' . $key);
        $setting->set('xtype', $type);
        $setting->set('value', $value);
        $setting->set('namespace', 'ajaxfileupload');
        $setting->set('area', '');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* create secret key */
            createSetting($modx, 'secret_key', sha1(uniqid(mt_rand(), true)), 'text-password');
            break;
    }
}
return true;
 * for basic usage.
 *
 * @package urlhistory
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'urlhistory.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'urlhistory.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'urlhistory');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/urlhistory/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/urlhistory/');
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/urlhistory/');
            break;
    }
}
return true;
 * Resolve paths. These are useful to change if you want to debug and/or develop
 * in a directory outside of the MODx webroot. They are not required to set
 * for basic usage.
 *
 * @package gitpackagemanagement
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'gitpackagemanagement.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'gitpackagemanagement.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'gitpackagemanagement');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* create gitpackagemanagement settings */
            createSetting($modx, 'packages_dir', '');
            createSetting($modx, 'packages_base_url', '/');
            break;
    }
}
return true;
Example #6
0
 * for basic usage.
 *
 * @package tools
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'tools.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'tools.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'tools');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            // setup paths
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/tools/');
            //createSetting($modx,'assets_path',$modx->getOption('assets_path').'components/tools/');
            // setup urls
            //createSetting($modx,'assets_url',$modx->getOption('assets_url').'components/tools/');
            break;
    }
}
return true;
 * for basic usage.
 *
 * @package modxboilerplate
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'modxboilerplate.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'modxboilerplate.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'modxboilerplate');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/modxboilerplate/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/modxboilerplate/');
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/modxboilerplate/');
            break;
    }
}
return true;
Example #8
0
 * for basic usage.
 *
 * @package clientlexicon
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'cl.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'cl.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'clientlexicon');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', '');
            createSetting($modx, 'assets_path', '');
            /* setup urls */
            createSetting($modx, 'assets_url', '');
            break;
    }
}
return true;
Example #9
0
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'gallery.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'gallery.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'gallery');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/gallery/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/gallery/');
            createSetting($modx, 'files_path', $modx->getOption('assets_path') . 'components/gallery/files/');
            createSetting($modx, 'phpthumb_path', $modx->getOption('assets_path') . 'components/phpthumb/');
            @mkdir($modx->getOption('assets_path') . 'components/gallery/files/', 0775);
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/gallery/');
            createSetting($modx, 'files_url', $modx->getOption('assets_url') . 'components/gallery/files/');
            createSetting($modx, 'phpthumb_url', $modx->getOption('assets_url') . 'components/phpthumb/');
            break;
    }
}
return true;
 * for basic usage.
 *
 * @package modextra
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'modextra.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'modextra.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'modextra');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/modextra/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/modextra/');
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/modextra/');
            break;
    }
}
return true;
Example #11
0
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'discuss.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'discuss.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'discuss');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
            $modx =& $object->xpdo;
            /* setup paths */
            //createSetting($modx,'core_path',$modx->getOption('core_path').'components/discuss/');
            //createSetting($modx,'assets_path',$modx->getOption('assets_path').'components/discuss/');
            createSetting($modx, 'attachments_path', $modx->getOption('assets_path') . 'components/discuss/attachments/');
            /* setup urls */
            //createSetting($modx,'assets_url',$modx->getOption('assets_url').'components/discuss/');
            createSetting($modx, 'files_url', $modx->getOption('assets_url') . 'components/discuss/files/');
            createSetting($modx, 'attachments_url', $modx->getOption('assets_url') . 'components/discuss/attachments/');
            break;
        case xPDOTransport::ACTION_UPGRADE:
            break;
    }
}
return true;
Example #12
0
 * for basic usage.
 *
 * @package staticsaver
 * @subpackage build
 */
function createSetting(&$modx, $key, $value)
{
    $ct = $modx->getCount('modSystemSetting', array('key' => 'staticsaver.' . $key));
    if (empty($ct)) {
        $setting = $modx->newObject('modSystemSetting');
        $setting->set('key', 'staticsaver.' . $key);
        $setting->set('value', $value);
        $setting->set('namespace', 'staticsaver');
        $setting->set('area', 'Paths');
        $setting->save();
    }
}
if ($object->xpdo) {
    switch ($options[xPDOTransport::PACKAGE_ACTION]) {
        case xPDOTransport::ACTION_INSTALL:
        case xPDOTransport::ACTION_UPGRADE:
            $modx =& $object->xpdo;
            /* setup paths */
            createSetting($modx, 'core_path', $modx->getOption('core_path') . 'components/staticsaver/');
            createSetting($modx, 'assets_path', $modx->getOption('assets_path') . 'components/staticsaver/');
            /* setup urls */
            createSetting($modx, 'assets_url', $modx->getOption('assets_url') . 'components/staticsaver/');
            break;
    }
}
return true;