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
2dff1936
authored
2010-06-22 21:23:37 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed some namespace bugs
1 parent
3c4bb773
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
com/HybridGallery/HybridGallery.php
com/ShortCodes/ShortCodes.php
com/HybridGallery/HybridGallery.php
View file @
2dff193
<?php
use
Tz\WordPress\Tools\ShortCodes
;
use
Tz\WordPress\Tools
;
//error_reporting(E_ALL);
/*
...
...
@@ -27,8 +31,8 @@ class HybridGallery {
$role
=
get_role
(
'administrator'
);
$role
->
add_cap
(
self
::
CAPABILITY
);
self
::
$widget_dir
=
T
zTools
::
tools_
url
(
'./'
,
__FILE__
);
self
::
$upload_dir
=
dirname
(
__FILE__
)
.
'/uploads/'
;
self
::
$widget_dir
=
T
ools\
url
(
'./'
,
__FILE__
);
self
::
$upload_dir
=
__DIR__
.
'/uploads/'
;
require
(
'inc/config.php'
);
self
::
$defaults
=
$config
;
...
...
@@ -39,10 +43,10 @@ class HybridGallery {
$mArr
[
$option
]
=
$items
[
0
];
}
self
::
$WP_Settings
=
new
WP_Option
(
self
::
SETTINGS_NS
,
$mArr
);
self
::
$WP_Settings
=
new
\
WP_Option
(
self
::
SETTINGS_NS
,
$mArr
);
ShortCodes
::
registerClass
(
'HybridGallery_ShortCodes'
);
add_actions
(
'HybridGallery_Actions'
);
ShortCodes
\
registerClass
(
'HybridGallery_ShortCodes'
);
Tools\
add_actions
(
'HybridGallery_Actions'
);
}
public
static
function
adminDisplay
()
{
...
...
@@ -97,8 +101,8 @@ class HybridGallery_Actions {
public
static
function
wp_print_scripts
()
{
wp_enqueue_script
(
'jquery'
);
wp_enqueue_script
(
'jquery-form'
);
_enqueue_script
(
'swfobject'
,
T
zTools
::
tools_
url
(
'assets/uploadify/swfobject.js'
,
__FILE__
),
array
(
'jquery'
));
_enqueue_script
(
'jquery-uploadify'
,
T
zTools
::
tools_
url
(
'assets/uploadify/jquery.uploadify.v2.1.0.js'
,
__FILE__
),
array
(
'jquery'
,
'swfobject'
));
_enqueue_script
(
'swfobject'
,
T
ools\
url
(
'assets/uploadify/swfobject.js'
,
__FILE__
),
array
(
'jquery'
));
_enqueue_script
(
'jquery-uploadify'
,
T
ools\
url
(
'assets/uploadify/jquery.uploadify.v2.1.0.js'
,
__FILE__
),
array
(
'jquery'
,
'swfobject'
));
}
}
...
...
@@ -109,7 +113,7 @@ class HybridGallery_ShortCodes {
public
static
function
HybridGallery
(
$args
=
array
(),
$content
,
$tag
)
{
$WP_Settings
=
new
WP_Option
(
HybridGallery
::
SETTINGS_NS
);
$WP_Settings
=
new
\
WP_Option
(
HybridGallery
::
SETTINGS_NS
);
foreach
(
HybridGallery
::
$defaults
as
$key
=>
$val
)
{
if
(
isset
(
$WP_Settings
[
$key
]))
{
...
...
com/ShortCodes/ShortCodes.php
View file @
2dff193
...
...
@@ -4,6 +4,8 @@ namespace Tz\WordPress\Tools\ShortCodes;
use
Tz\WordPress\Tools
;
use
WP_Option
;
use
\ReflectionClass
,
\ReflectionMethod
,
\ReflectionFunction
;
use
\Exception
;
...
...
@@ -31,7 +33,7 @@ function add_shortcodes($class) {
}
function
registerClass
(
$class
)
{
call_user_func
(
'
add_shortcodes'
,
$class
);
call_user_func
(
__NAMESPACE__
.
'\
add_shortcodes'
,
$class
);
}
function
add
(
$code
,
$callback
)
{
...
...
Please
register
or
sign in
to post a comment