boolean AdminDisplayToolbar(
array
&$params
)
|
|
Display a toolbar in admin
Parameters:
|
array |
&$params: |
Associative array of parameters |
API Tags:
| Return: | did we display a toolbar? |
Redefinition of:
- Plugin::AdminDisplayToolbar()
- Event handler: Called when displaying editor toolbars.
Spits out the styles used
API Tags:
Redefinition of:
- Plugin::AdminEndHtmlHead()
- Event handler: Called when ending the admin html head section.
string create_number(
integer
$num
)
|
|
Creates the SwipeFriendly line numbers
Parameters:
|
integer |
$num: |
the line number to produce |
API Tags:
| Return: | the html for the line number |
string do_numbering(
string
$code, [string
$offset = 0], [string
$type = 'code']
)
|
|
Formats code ready for displaying With "SwipeFriendly" line numbers
Parameters:
|
string |
$code: |
the code block to be wrapped up |
|
string |
$offset: |
the attributes - currently only the starting line number |
|
string |
$type: |
the code type ( code || php ) |
API Tags:
Information Tags:
| Todo: | fp> no table should be needed. Also since we have odd/even coloring, word wrapping may be ok. yabs > unfortunately the tables are required to make the odd/even colouring and swipeable numbers work :( an example : Danny uploaded a page to demo his colours of choice ( http://brendoman.com/dev/youtube.html ) if you scroll down to RenderItemAsHtml() you'll see it has 4 problems 1) some lines wrap - but they wrap underneath the line number 2) some lines don't wrap so they force a browser scrollbar ( although a scrollable div will cure this) 3) the lines that don't wrap lose their background colour once they become longer than the browser width ( a scrollable div has the same problem ) 4) If you try and copy/paste the code you also get the line numbers ( like every other code formatter that we've seen on the web that uses line numbers ... which is why most don't ;) ) compare that to the same section of code using this plugin ( http://cvs.astonishme.co.uk/index.php/2007/04/01/a_demo ) fp> almost all that can be fixed with proper CSS and will have the advantage of not adding extra space in front of the lines when copy/pasting. I'll work on it when I have time. yabs> The operative word in that sentance is "almost" ;) ... I've removed the trailing spaces for all but empty lines ( required to "prop them open" ) ... I'd forgotten all about them :p |
void FilterItemContents(
&$params, mixed
$params
)
|
|
Filters out the custom tag that would not validate, PLUS escapes the actual code.
Parameters:
string filter_codeblock_callback(
array
$block
)
|
|
Formats code ready for the database
Parameters:
|
array |
$block: |
( 2 - attributes, 3 - the code ) |
API Tags:
| Return: | formatted code || empty |
void filter_codespan_callback(
$matches
)
|
|
Format codespan for display
This is a bit quick 'n dirty. We might want to unfilter this too. We might want to highlight this too (based on a lang attribute).
Parameters:
string format_to_edit(
array
$block
)
|
|
Formats code ready for editing
Parameters:
|
array |
$block: |
( 1 - attributes, 2 - the code ) |
API Tags:
array GetDefaultSettings(
&$params
)
|
|
Get the settings that the plugin can use.
Those settings are transfered into a Settings member object of the plugin and can be edited in the backoffice (Settings / Plugins).
Parameters:
API Tags:
Redefinition of:
- Plugin::GetDefaultSettings()
- Define here default settings that are then available in the backoffice.
void PluginInit(
&$params
)
|
|
Init
Parameters:
Redefinition of:
- Plugin::PluginInit()
- Init the Plugin after it has been registered/instantiated.
void PluginVersionChanged(
)
|
|
Upgrade stuff for old style code posts
API Tags:
Redefinition of:
- Plugin::PluginVersionChanged()
- Event handler: Called when we detect a version change (in Plugins::register()).
void RenderItemAsHtml(
&$params
)
|
|
Perform rendering
Parameters:
API Tags:
Redefinition of:
- Plugin::RenderItemAsHtml()
- Event handler: Called when rendering item/post contents as HTML. (CACHED)
void RenderItemAsXml(
&$params
)
|
|
Perform rendering
Parameters:
API Tags:
| See: | Plugin::RenderItemAsXml()
Note : Do we actually want to do this? - yabs |
Redefinition of:
- Plugin::RenderItemAsXml()
- Event handler: Called when rendering item/post contents as XML.
string render_codeblock_callback(
array
$block
)
|
|
Formats codeblock ready for displaying
Each language is stored as a classfile This would allow new languages to be added more easily It would also allow Geshi to be used as the highlighter with no code changes ;)
Replaces both (current) highlighter functions
..... still requires some more thought though :p
Parameters:
|
array |
$block: |
( 2 - attributes, 4 - the code ) |
API Tags:
void SkinBeginHtmlHead(
)
|
|
Spits out the styles used
API Tags:
Redefinition of:
- Plugin::SkinBeginHtmlHead()
- Event handler: Called at the beginning of the skin's HTML HEAD section.
string tidy_code_output(
string
$block, [string
$line_seperator = "\n"]
)
|
|
Tidys up a block of code ready for numbering
Parameters:
|
string |
$block: |
- the code to be tidied up |
|
string |
$line_seperator: |
- the seperator between lines of code ( default \n ) |
API Tags:
| Return: | - the tidied code |
void UnfilterItemContents(
&$params, mixed
$params
)
|
|
Formats post contents ready for editing
Parameters: