-
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.
- Loading branch information
1 parent
832b39c
commit 72fc382
Showing
2 changed files
with
85 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,90 @@ | ||
<?php | ||
class IntenseDebatePlugin extends Omeka_Plugin_AbstractPlugin | ||
{ | ||
protected $_hooks = array( | ||
'install', | ||
'uninstall', | ||
'config_form', | ||
'config', | ||
'public_items_show', | ||
'public_collections_show', | ||
); | ||
|
||
|
||
protected $_options = array( | ||
'id_account'=>null, | ||
'id_items'=>1, | ||
'id_collections'=>0, | ||
); | ||
|
||
/* | ||
|
||
protected $_hooks = array( | ||
'install', | ||
'uninstall', | ||
'config_form', | ||
'config', | ||
'public_items_show', | ||
'public_collections_show', | ||
); | ||
|
||
|
||
protected $_options = array( | ||
'id_account'=>null, | ||
'id_items'=>1, | ||
'id_collections'=>0, | ||
); | ||
|
||
|
||
/* | ||
** Plugin options | ||
*/ | ||
|
||
public function hookConfigForm() | ||
{ | ||
require dirname(__FILE__) . '/config_form.php'; | ||
} | ||
|
||
public function hookConfig() | ||
{ | ||
|
||
set_option('id_account', $_POST['id_account']); | ||
set_option('id_items', (bool)(int)$_POST['id_items']); | ||
set_option('id_collections', (bool)(int)$_POST['id_collections']); | ||
|
||
} | ||
|
||
/* | ||
|
||
public function hookConfigForm() | ||
{ | ||
require dirname(__FILE__) . '/config_form.php'; | ||
} | ||
|
||
public function hookConfig() | ||
{ | ||
set_option('id_account', $_POST['id_account']); | ||
set_option('id_items', (bool)(int)$_POST['id_items']); | ||
set_option('id_collections', (bool)(int)$_POST['id_collections']); | ||
} | ||
|
||
/* | ||
** Public display | ||
*/ | ||
|
||
public function hookPublicItemsShow(){ | ||
|
||
|
||
public function hookPublicItemsShow() | ||
{ | ||
|
||
echo id_display_comments(get_option('id_items')); | ||
|
||
} | ||
|
||
public function hookPublicCollectionsShow(){ | ||
|
||
echo id_display_comments(get_option('id_collections')); | ||
|
||
} | ||
|
||
|
||
/** | ||
* Install the plugin. | ||
*/ | ||
public function hookInstall() | ||
{ | ||
$this->_installOptions(); | ||
} | ||
|
||
/** | ||
* Uninstall the plugin. | ||
*/ | ||
public function hookUninstall() | ||
{ | ||
$this->_uninstallOptions(); | ||
} | ||
/** | ||
* Install the plugin. | ||
*/ | ||
public function hookInstall() | ||
{ | ||
$this->_installOptions(); | ||
|
||
} | ||
|
||
/** | ||
* Uninstall the plugin. | ||
*/ | ||
public function hookUninstall() | ||
{ | ||
$this->_uninstallOptions(); | ||
|
||
} | ||
} | ||
|
||
function id_display_comments($option=null){ | ||
|
||
if( ($id=get_option('id_account')) && ($option==1) ){ | ||
$html = '<div id="id_comments">'; | ||
$html .= '<script>'; | ||
$html .= 'var idcomments_acct = "'.$id.'";'; | ||
$html .= 'var idcomments_post_id;'; | ||
$html .= 'var idcomments_post_url;'; | ||
$html .= '</script>'; | ||
$html .= '<span id="IDCommentsPostTitle" style="display:none"></span>'; | ||
$html .= '<script type="text/javascript" src="http://www.intensedebate.com/js/genericCommentWrapperV2.js"></script>'; | ||
$html .= '</div>'; | ||
|
||
return $html; | ||
} | ||
|
||
function id_display_comments($option=null) | ||
{ | ||
if( ($id=get_option('id_account')) && ($option==1) ){ | ||
$html = '<div id="id_comments">'; | ||
$html .= '<script>'; | ||
$html .= 'var idcomments_acct = "'.$id.'";'; | ||
$html .= 'var idcomments_post_id;'; | ||
$html .= 'var idcomments_post_url;'; | ||
$html .= '</script>'; | ||
$html .= '<span id="IDCommentsPostTitle" style="display:none"></span>'; | ||
$html .= '<script type="text/javascript" src="http://www.intensedebate.com/js/genericCommentWrapperV2.js"></script>'; | ||
$html .= '</div>'; | ||
|
||
return $html; | ||
} | ||
} |
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