Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a8e73e7b
authored
2010-04-15 16:05:56 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Changed plugins_url to tools_url to facilitate move of tz-tools to wp-content
1 parent
305bda06
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
11 deletions
com/Branding/Branding.php
com/PagePermissions/PagePermissions.php
com/ShortCodes/ShortCodes.php
lib/MenuWidget.php
tz-tools.php
com/Branding/Branding.php
View file @
a8e73e7
...
...
@@ -7,7 +7,7 @@ class Branding {
class
Branding_Actions
{
public
static
function
admin_print_styles
()
{
_enqueue_style
(
'branding-style'
,
plugin
s_url
(
'css/tenzing.css'
,
__FILE__
));
_enqueue_style
(
'branding-style'
,
TzTools
::
tool
s_url
(
'css/tenzing.css'
,
__FILE__
));
}
public
static
function
admin_head
()
{
...
...
@@ -22,7 +22,7 @@ class Branding_Actions {
}
public
static
function
login_head
()
{
echo
'<link rel="stylesheet" type="text/css" href="'
.
plugin
s_url
(
'css/tz_login.css'
,
__FILE__
)
.
'" />'
;
echo
'<link rel="stylesheet" type="text/css" href="'
.
TzTools
::
tool
s_url
(
'css/tz_login.css'
,
__FILE__
)
.
'" />'
;
}
}
...
...
com/PagePermissions/PagePermissions.php
View file @
a8e73e7
...
...
@@ -285,7 +285,7 @@ class PagePermissions_Actions {
ob_end_clean
();
}
_enqueue_script
(
'page-permissions'
,
plugin
s_url
(
'PagePermissions.js'
,
__FILE__
));
_enqueue_script
(
'page-permissions'
,
TzTools
::
tool
s_url
(
'PagePermissions.js'
,
__FILE__
));
_localize_script
(
'page-permissions'
,
'TzPagePermissionsData'
,
Array
(
'trigger'
=>
PagePermissions
::
ELE_SEL
,
'focus'
=>
PagePermissions
::
OPT_CUST
...
...
com/ShortCodes/ShortCodes.php
View file @
a8e73e7
...
...
@@ -110,7 +110,7 @@ class ShortCodes_Actions {
public
static
function
admin_print_scripts
()
{
if
(
$GLOBALS
[
'editing'
])
{
_enqueue_script
(
'shortcoder'
,
plugin
s_url
(
'shortcoder.js'
,
__FILE__
),
Array
(
'jquery'
));
_enqueue_script
(
'shortcoder'
,
TzTools
::
tool
s_url
(
'shortcoder.js'
,
__FILE__
),
Array
(
'jquery'
));
echo
"<script type=
\"
text/javascript
\"
>
\n
/* <![CDATA[ */
\n
"
;
echo
'var TzRegisteredShortCodes = '
.
json_encode
(
ShortCodes
::
getRegistered
());
...
...
lib/MenuWidget.php
View file @
a8e73e7
...
...
@@ -4,7 +4,7 @@ class MenuWidget extends WP_Widget {
register_widget
(
__CLASS__
);
if
(
is_admin
())
{
_enqueue_script
(
'tz-menu-widget'
,
plugin
s_url
(
'MenuWidget.js'
,
__FILE__
),
Array
(
'addEvent'
));
_enqueue_script
(
'tz-menu-widget'
,
TzTools
::
tool
s_url
(
'MenuWidget.js'
,
__FILE__
),
Array
(
'addEvent'
));
}
}
...
...
tz-tools.php
View file @
a8e73e7
<?php
/*
Plugin Name: Tenzing Tools
Version: 0.
1
Description: Various classes to help out with stuff
Version: 0.
3b
Description: Various classes
and functions
to help out with stuff
Author: Tenzing
*/
...
...
@@ -18,9 +18,9 @@ class TzTools {
require_once
(
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'wp_functions.php'
);
_register_script
(
'addEvent'
,
plugin
s_url
(
'addEvent.js'
,
__FILE__
));
_register_script
(
'xmlhttpHandler'
,
plugin
s_url
(
'xmlhttpHandler.js'
,
__FILE__
));
_register_script
(
'fireEvent'
,
plugin
s_url
(
'fireEvent.js'
,
__FILE__
));
_register_script
(
'addEvent'
,
self
::
tool
s_url
(
'addEvent.js'
,
__FILE__
));
_register_script
(
'xmlhttpHandler'
,
self
::
tool
s_url
(
'xmlhttpHandler.js'
,
__FILE__
));
_register_script
(
'fireEvent'
,
self
::
tool
s_url
(
'fireEvent.js'
,
__FILE__
));
add_action
(
'widgets_init'
,
Array
(
'MenuWidget'
,
'init'
));
self
::
import
(
'ShortCodes'
);
...
...
@@ -40,6 +40,14 @@ class TzTools {
include
(
$file
);
}
}
public
static
function
tools_url
(
$script
,
$base_file
=
false
)
{
$base_dir
=
(
false
===
$base_file
?
dirname
(
__FILE__
)
:
dirname
(
$base_file
));
$rel_path
=
str_replace
(
ABSPATH
,
''
,
$base_dir
);
$script
=
site_url
()
.
'/'
.
$rel_path
.
'/'
.
$script
;
return
$script
;
}
}
function
add_actions
(
$class
)
{
...
...
@@ -103,4 +111,4 @@ function _custom_revision() {
$args
=
func_get_args
();
return
call_user_func_array
(
'_custom_page'
,
$args
);
}
?>
\ No newline at end of file
?>
...
...
Please
register
or
sign in
to post a comment