Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Masuga committed Mar 8, 2009
0 parents commit aa595ad
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.DS_Store
md-hide-smileys.tmproj
24 changes: 24 additions & 0 deletions README.textile
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
127 changes: 127 additions & 0 deletions extensions/ext.md_hide_smileys.php
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>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;</span>", $out);

return $out;
}
}
// END CLASS
?>

0 comments on commit aa595ad

Please sign in to comment.