Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apex_micro_site
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Ali Arshad
apex_micro_site
Commits
7ac94d7c
You need to sign in or sign up before continuing.
Commit
7ac94d7c
authored
May 08, 2018
by
nadeem.qasmi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
course list pdf file upload fix
parent
a21734a3
Pipeline
#482
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
lms-setting.php
.../wp-content/plugins/apex_global_lms/admin/lms-setting.php
+89
-0
No files found.
WWW_DATA/wp-content/plugins/apex_global_lms/admin/lms-setting.php
View file @
7ac94d7c
...
...
@@ -289,6 +289,19 @@ function vq_lms_settings_init()
'vq_lms_settings_custom_data'
=>
'custom'
,
]
);
add_settings_field
(
'vq_lms_settings_field_courselist'
,
'Courselist'
,
'vq_lms_settings_field_courselist_cb'
,
'vq_lms_settings'
,
'vq_lms_settings_section_developers'
,
[
'label_for'
=>
'vq_lms_settings_field_courselist'
,
'class'
=>
'vq_lms_settings_row'
,
'vq_lms_settings_custom_data'
=>
'custom'
,
]
);
}
function
vq_lms_settings_section_developers_cb
(
$args
)
...
...
@@ -422,6 +435,82 @@ function vq_lms_settings_field_video_cb($args)
<?php
}
/////
function
vq_lms_settings_field_courselist_cb
(
$args
)
{
wp_enqueue_media
();
$options
=
get_option
(
'vq_lms_settings_options'
);
if
(
$options
[
$args
[
'label_for'
]])
{
?>
<div
style=
"width: 200px;"
id=
"courselist_holder"
>
<file
id=
"clist"
src=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
</file>
</div>
<?php
}
if
(
$options
[
$args
[
'label_for'
]]
==
''
){
?>
<input
type=
"text"
name=
"attachment"
value=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
placeholder =
"No File Uploaded"
disabled =
"true"
>
<?php
}
else
{
?>
<iframe
src=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
style=
"width:200px; height:120px;"
frameborder=
"0"
></iframe><br><div>
</div>
<?php
}
?>
<input
type=
"button"
id=
"vq_lms_courselist"
class=
"button"
value=
"Upload Course List"
>
<input
type=
"button"
id=
"vq_lms_remove_courselist"
class=
"button"
value=
"Remove"
>
<input
type=
"hidden"
id=
"vq_lms_courselist_hidden"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]);
?>
]"
value=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
<p
class=
"description"
>
<?php
esc_html_e
(
'attachment file.'
,
'vq_lms_settings'
);
?>
</p>
<script>
var
mediaUploader
;
jQuery
(
"#vq_lms_remove_courselist"
).
on
(
'click'
,
function
()
{
jQuery
(
"#vq_lms_courselist_hidden"
).
val
(
''
);
jQuery
(
"#clist"
).
attr
(
'src'
,
''
);
});
jQuery
(
'#vq_lms_courselist'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
if
(
mediaUploader
)
{
mediaUploader
.
open
();
return
;
}
mediaUploader
=
wp
.
media
.
frames
.
file_frame
=
wp
.
media
({
title
:
'Select File'
,
button
:
{
text
:
'Choose File'
},
multiple
:
false
});
mediaUploader
.
on
(
'select'
,
function
()
{
attachment
=
mediaUploader
.
state
().
get
(
'selection'
).
first
().
toJSON
();
jQuery
(
"#vq_lms_courselist_hidden"
).
val
(
attachment
.
url
);
jQuery
(
"#clist"
).
attr
(
'src'
,
attachment
.
url
);
});
mediaUploader
.
open
();
});
</script>
<?php
}
/////
function
vq_lms_settings_field_shortcode_cb
()
{
echo
'[vq_short_banner bgClr="" btnBg="" txt="" txtClr="" btnClr="" btnLink="" btnTxt=""]'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment