forked from masugadesign/md.hide_smileys.ee_addon
-
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
Ryan Masuga
committed
Mar 8, 2009
0 parents
commit aa595ad
Showing
3 changed files
with
153 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.DS_Store | ||
md-hide-smileys.tmproj |
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,24 @@ | ||
h1. MD Hide Smileys | ||
|
||
Hide Smileys under every Textarea in the EE Control Panel. | ||
|
||
I made this simply to hide the "Smileys" link underneath each textarea on a Control Panel publish page. You can disable Emoticons in the admin, but I don’t think there is any native way to hide this link without an extension. | ||
|
||
h2. Info | ||
|
||
Developed by Ryan Masuga, http://masugadesign.com | ||
|
||
Docs: "MD Hide Smileys":http://www.masugadesign.com/the-lab/scripts/hide-smileys/ <br /> | ||
General EE Extension Info: http://expressionengine.com/docs/development/extensions.html | ||
|
||
ExpressionEngine forum Thread: "Extension: Hide Smileys Link in Control Panel":http://expressionengine.com/forums/viewthread/56203/ | ||
|
||
h2. Changelog | ||
|
||
*1.0.1 (Mar 8, 2009)* | ||
|
||
* Changed name to MD Hide Smileys | ||
|
||
1.0.0 (Jul 11, 2007) | ||
|
||
* Initial release |
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,127 @@ | ||
<?php | ||
|
||
/* =========================================================================== | ||
ext.md_hide_smileys.php --------------------------- | ||
Hide the smileys link(s) on the publish page. | ||
INFO --------------------------- | ||
Developed by: Ryan Masuga, masugadesign.com | ||
Created: Jul 10 2007 | ||
Last Mod: Mar 08 2009 | ||
http://expressionengine.com/docs/development/extensions.html | ||
=============================================================================== */ | ||
|
||
class Md_hide_smileys | ||
{ | ||
var $settings = array(); | ||
|
||
var $name = 'MD Hide Smileys'; | ||
var $version = '1.0.1'; | ||
var $description = 'Hide the smileys link(s) on Publish pages in the Control Panel.'; | ||
var $settings_exist = 'n'; | ||
var $docs_url = 'http://www.masugadesign.com/the-lab/scripts/hide-smileys/'; | ||
|
||
|
||
// ------------------------------- | ||
// Constructor - Extensions use this for settings | ||
// ------------------------------- | ||
|
||
function Md_hide_smileys($settings='') | ||
{ | ||
$this->settings = $settings; | ||
} | ||
// END | ||
|
||
|
||
// -------------------------------- | ||
// Activate Extension | ||
// -------------------------------- | ||
|
||
function activate_extension() | ||
{ | ||
global $DB; | ||
|
||
$DB->query($DB->insert_string('exp_extensions', | ||
array( | ||
'extension_id' => '', | ||
'class' => get_class($this), | ||
'method' => "hide_smileylink", | ||
'hook' => "show_full_control_panel_end", | ||
'settings' => "", | ||
'priority' => 10, | ||
'version' => $this->version, | ||
'enabled' => "y" | ||
) | ||
) | ||
); | ||
} | ||
// END | ||
|
||
// | ||
// Change Settings | ||
// | ||
function settings() | ||
{ | ||
$settings = array(); | ||
|
||
return $settings; | ||
} | ||
|
||
// -------------------------------- | ||
// Update Extension | ||
// -------------------------------- | ||
|
||
function update_extension($current='') | ||
{ | ||
global $DB; | ||
|
||
if ($current == '' OR $current == $this->version) | ||
{ | ||
return FALSE; | ||
} | ||
if ($current < '1.0.1') | ||
{ | ||
// Update to next version 1.0.1 | ||
} | ||
|
||
$DB->query("UPDATE exp_extensions | ||
SET version = '".$DB->escape_str($this->version)."' | ||
WHERE class = '".get_class($this)."'"); | ||
} | ||
// END | ||
|
||
|
||
// -------------------------------- | ||
// Disable Extension | ||
// -------------------------------- | ||
|
||
function disable_extension() | ||
{ | ||
global $DB; | ||
$DB->query("DELETE FROM exp_extensions WHERE class = '".$DB->escape_str(get_class($this))."'"); | ||
} | ||
// END | ||
|
||
|
||
// ----------------------------- | ||
// Da function | ||
// ----------------------------- | ||
|
||
|
||
function hide_smileylink( $out ) | ||
{ | ||
global $EXT; | ||
|
||
if($EXT->last_call !== false) | ||
{ | ||
$out = $EXT->last_call; | ||
} | ||
|
||
$out = preg_replace("#<b>Glossary</b></a>[^\r\n]*</span>#", "<b>Glossary</b></a> | </span>", $out); | ||
|
||
return $out; | ||
} | ||
} | ||
// END CLASS | ||
?> |