Skip to content

Commit

Permalink
Changes to Garden
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis St-Amour committed Feb 21, 2010
1 parent d3c5850 commit c1ba39d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
1 change: 1 addition & 0 deletions conf/config-defaults.php
Expand Up @@ -81,6 +81,7 @@
$Configuration['Garden']['Thumbnail']['Size'] = 50;
$Configuration['Garden']['Menu']['Sort'] = array('Dashboard', 'Discussions', 'Activity', 'Conversations', 'User');
$Configuration['Garden']['InputFormatter'] = 'Html';
$Configuration['Garden']['Html']['nl2br'] = TRUE;

// Default Preferences
$Configuration['Preferences']['Email']['ConversationMessage'] = '1';
Expand Down
30 changes: 29 additions & 1 deletion library/core/class.controller.php
Expand Up @@ -375,13 +375,41 @@ public function AddDefinition($Term, $Definition = NULL) {
/**
* Adds a JS file to search for in the application or global js folder(s).
*
* @param string $FileName The CSS file to search for.
* @param string $FileName The JS file to search for.
* @param string $AppFolder The application folder that should contain the JS file. Default is to
* use the application folder that this controller belongs to.
*/
public function AddJsFile($FileName, $AppFolder = '') {
$this->_JsFiles[] = array('FileName' => $FileName, 'AppFolder' => $AppFolder);
}

/**
* Removes a CSS file to search for in the theme folder(s).
*
* @param string $FileName The CSS file to search for.
* @param string $AppFolder The application folder that should contain the CSS file. Default is to
* use the application folder that this controller belongs to.
*/
public function RemoveCssFile($FileName, $AppFolder = '') {
$keys = array_keys($this->_CssFiles, array('FileName' => $FileName, 'AppFolder' => $AppFolder));
foreach($keys as $key) {
unset($this->_CssFiles[$key]);
}
}

/**
* Removes a JS file to search for in the application or global js folder(s).
*
* @param string $FileName The JS file to search for.
* @param string $AppFolder The application folder that should contain the JS file. Default is to
* use the application folder that this controller belongs to.
*/
public function RemoveJsFile($FileName, $AppFolder = '') {
$keys = array_keys($this->_JsFiles, array('FileName' => $FileName, 'AppFolder' => $AppFolder));
foreach($keys as $key) {
unset($this->_JsFiles[$key]);
}
}

/**
* Adds the specified module to the specified asset target. If no asset
Expand Down
6 changes: 4 additions & 2 deletions library/core/class.format.php
Expand Up @@ -235,8 +235,10 @@ public static function Html($Mixed) {
$Mixed
);

// nl2br
$Mixed = preg_replace("/(\015\012)|(\015)|(\012)/", "<br />", $Mixed);
if(Gdn::Config('Garden.Html.nl2br', TRUE)) {
// nl2br
$Mixed = preg_replace("/(\015\012)|(\015)|(\012)/", "<br />", $Mixed);
}

return $Formatter->Format($Mixed);
}
Expand Down
2 changes: 1 addition & 1 deletion library/core/interface.iplugin.php
Expand Up @@ -28,7 +28,7 @@
* them.
*
* @package Garden
* @todo Could it include a Disable and Uninstall method? (from damien)
* @todo Document the existence of OnDisable & CleanUp function calls (optional so they don't appear here)
*/
interface Gdn_IPlugin {

Expand Down
9 changes: 8 additions & 1 deletion plugins/CKEditor/default.php
Expand Up @@ -29,9 +29,16 @@ public function Base_Render_Before(&$Sender) {
$Sender->AddJsFile('/plugins/CKEditor/ckeditor/ckeditor.js');
$Sender->AddJsFile('/plugins/CKEditor/ckeditor/adapters/jquery.js');
$Sender->AddJsFile('/plugins/CKEditor/start.js');

$Sender->RemoveJsFile('js/library/jquery.autogrow.js');
$Sender->RemoveJsFile('/js/library/jquery.autogrow.js');
$Sender->RemoveJsFile('autosave.js');
$Sender->RemoveJsFile('post.js');
//$Sender->RemoveJsFile('autosave.js');
}

public function DiscussionController_BeforeDiscussionRender_Handler(&$Sender) {
$Sender->RemoveJsFile('discussion.js');
$Sender->AddJsFile('/plugins/CKEditor/discussion.js');
}

/* Adding CKEditor settings link to side menu */
Expand Down

0 comments on commit c1ba39d

Please sign in to comment.