-
Notifications
You must be signed in to change notification settings - Fork 33
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
7 changed files
with
122 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** @var modX $modx */ | ||
|
||
$category= $modx->newObject('modCategory'); | ||
$category->set('id',1); | ||
$category->set('category',PKG_NAME); | ||
|
||
|
||
$category_attr = array( | ||
xPDOTransport::UNIQUE_KEY => 'category', | ||
xPDOTransport::PRESERVE_KEYS => false, | ||
xPDOTransport::UPDATE_OBJECT => true, | ||
xPDOTransport::RELATED_OBJECTS => true, | ||
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array ( | ||
'Snippets' => array( | ||
xPDOTransport::PRESERVE_KEYS => false, | ||
xPDOTransport::UPDATE_OBJECT => true, | ||
xPDOTransport::UNIQUE_KEY => 'name', | ||
), | ||
'Chunks' => array( | ||
xPDOTransport::PRESERVE_KEYS => false, | ||
xPDOTransport::UPDATE_OBJECT => true, | ||
xPDOTransport::UNIQUE_KEY => 'name', | ||
), | ||
'Plugins' => array( | ||
xPDOTransport::UNIQUE_KEY => 'name', | ||
xPDOTransport::PRESERVE_KEYS => false, | ||
xPDOTransport::UPDATE_OBJECT => true, | ||
xPDOTransport::RELATED_OBJECTS => true, | ||
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array ( | ||
'PluginEvents' => array( | ||
xPDOTransport::PRESERVE_KEYS => true, | ||
xPDOTransport::UPDATE_OBJECT => false, | ||
xPDOTransport::UNIQUE_KEY => array('pluginid','event'), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
|
||
$modx->log(modX::LOG_LEVEL_INFO,'Added ImagePlus Category'); |
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,19 @@ | ||
<?php | ||
|
||
function getChunkContent($filename) { | ||
$o = file_get_contents($filename); | ||
return $o; | ||
} | ||
$chunks = array(); | ||
|
||
/** | ||
* Demo Output Snippet | ||
*/ | ||
$s = $modx->newObject('modChunk'); | ||
$s->fromArray(array( | ||
'name' => 'ImagePlus.demo', | ||
'description' => 'Demo output chunk for Image+', | ||
'snippet' => getChunkContent(PKG_CORE.'elements/chunks/ImagePlus.demo.html'), | ||
)); | ||
$chunks[] = $s; | ||
$modx->log(xPDO::LOG_LEVEL_INFO,"Added chunk 'ImagePlus.demo' to package"); |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
function getSnippetContent($filename) { | ||
$o = file_get_contents($filename); | ||
$o = trim(str_replace(array('<?php','?>'),'',$o)); | ||
return $o; | ||
} | ||
$snippets = array(); | ||
|
||
/** | ||
* Demo Output Snippet | ||
*/ | ||
$s = $modx->newObject('modSnippet'); | ||
$s->fromArray(array( | ||
'name' => 'ImagePlus.demo', | ||
'description' => 'Demo output snippet for Image+', | ||
'snippet' => getSnippetContent(PKG_CORE.'elements/snippets/ImagePlus.demo.php'), | ||
)); | ||
$snippets[] = $s; | ||
$modx->log(xPDO::LOG_LEVEL_INFO,"Added snippet 'ImagePlus.demo' to package"); | ||
|
||
/** | ||
* Image renderer snippet | ||
*/ | ||
$s = $modx->newObject('modSnippet'); | ||
$s->fromArray(array( | ||
'name' => 'image', | ||
'description' => 'Dynamic output renderer for Image+', | ||
'snippet' => getSnippetContent(PKG_CORE.'elements/snippets/image.php'), | ||
)); | ||
$snippets[] = $s; | ||
$modx->log(xPDO::LOG_LEVEL_INFO,"Added snippet 'image' to package"); |
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