forked from modxcms/Quip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed modAction and modRestClient to get Quip work in 3.x
- Loading branch information
1 parent
0414fb9
commit 062e66f
Showing
7 changed files
with
231 additions
and
34 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
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,105 @@ | ||
<?php | ||
/** | ||
* Quip | ||
* | ||
* Copyright 2010-11 by Shaun McCormick <[email protected]> | ||
* | ||
* This file is part of Quip, a simple commenting component for MODx Revolution. | ||
* | ||
* Quip is free software; you can redistribute it and/or modify it under the | ||
* terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* Quip is distributed in the hope that it will be useful, but WITHOUT ANY | ||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* Quip; if not, write to the Free Software Foundation, Inc., 59 Temple Place, | ||
* Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* @package quip | ||
*/ | ||
|
||
require_once dirname(dirname(__FILE__)) . '/model/quip/quip.class.php'; | ||
|
||
//class QuipHomeManagerController extends QuipManagerController { | ||
|
||
class QuipIndexManagerController extends modExtraManagerController { | ||
/** @var Quip $quip */ | ||
public $quip; | ||
public function initialize() { | ||
$this->quip = new Quip($this->modx); | ||
|
||
$this->addCss($this->quip->config['cssUrl'].'mgr.css'); | ||
$this->addJavascript($this->quip->config['jsUrl'].'quip.js'); | ||
$this->addHtml('<script type="text/javascript"> | ||
Ext.onReady(function() { | ||
Quip.config = '.$this->modx->toJSON($this->quip->config).'; | ||
Quip.config.connector_url = "'.$this->quip->config['connectorUrl'].'"; | ||
}); | ||
</script>'); | ||
|
||
$this->checkForApproval(); | ||
$this->checkForRejection(); | ||
return parent::initialize(); | ||
} | ||
|
||
|
||
public function process(array $scriptProperties = array()) { | ||
|
||
} | ||
public function getLanguageTopics() { | ||
return array('quip:default'); | ||
} | ||
public function getPageTitle() { return $this->modx->lexicon('quip'); } | ||
public function checkPermissions() { return true;} | ||
|
||
|
||
public function loadCustomCssJs() { | ||
$this->addJavascript($this->quip->config['jsUrl'].'widgets/comments.grid.js'); | ||
$this->addJavascript($this->quip->config['jsUrl'].'widgets/threads.panel.js'); | ||
$this->addLastJavascript($this->quip->config['jsUrl'].'sections/home.js'); | ||
} | ||
public function getTemplateFile() { return $this->quip->config['templatesPath'].'home.tpl'; } | ||
public function checkForApproval() { | ||
if (!empty($_REQUEST['quip_approve'])) { | ||
/** @var quipComment $comment */ | ||
$comment = $this->modx->getObject('quipComment',$_REQUEST['quip_approve']); | ||
if ($comment && $comment->approve()) { | ||
$commentArray = $comment->toArray(); | ||
$commentArray['createdon'] = strftime('%b %d, %Y',strtotime($comment->get('createdon'))); | ||
$this->modx->regClientStartupHTMLBlock('<script type="text/javascript"> | ||
Ext.onReady(function() { | ||
MODx.msg.status({ | ||
title: "'.$this->modx->lexicon('quip.comment_approved').'" | ||
,message: "'.$this->modx->lexicon('quip.comment_approved_msg',$commentArray).'" | ||
,delay: 5 | ||
}); | ||
}); | ||
</script>'); | ||
} | ||
} | ||
} | ||
public function checkForRejection() { | ||
if (!empty($_REQUEST['quip_reject'])) { | ||
/** @var quipComment $comment */ | ||
$comment = $this->modx->getObject('quipComment',$_REQUEST['quip_reject']); | ||
if ($comment && $comment->reject()) { | ||
$commentArray = $comment->toArray(); | ||
$commentArray['createdon'] = strftime('%b %d, %Y',strtotime($comment->get('createdon'))); | ||
$this->modx->regClientStartupHTMLBlock('<script type="text/javascript"> | ||
Ext.onReady(function() { | ||
MODx.msg.status({ | ||
title: "'.$this->modx->lexicon('quip.comment_deleted').'" | ||
,message: "'.$this->modx->lexicon('quip.comment_deleted_msg',$commentArray).'" | ||
,delay: 5 | ||
}); | ||
}); | ||
</script>'); | ||
} | ||
} | ||
} | ||
} | ||
|
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
Oops, something went wrong.
062e66f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have missed one more correction on getList, on line modxcms#9 at notifications.grid.js