aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Admin/Site.php14
-rw-r--r--Zotlabs/Module/Cover_photo.php8
-rw-r--r--Zotlabs/Module/Profile_photo.php6
-rw-r--r--Zotlabs/Update/_1204.php6
-rw-r--r--view/js/mod_cover_photo.js80
-rw-r--r--view/js/mod_profile_photo.js82
-rw-r--r--view/tpl/admin_settings_features.tpl4
-rwxr-xr-xview/tpl/admin_site.tpl2
-rwxr-xr-xview/tpl/cover_photo.tpl83
-rwxr-xr-xview/tpl/profile_edit.tpl16
-rwxr-xr-xview/tpl/profile_photo.tpl86
11 files changed, 203 insertions, 184 deletions
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 880dbbe4b..015c6535c 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -24,7 +24,7 @@ class Site {
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
- $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
+// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
@@ -122,11 +122,11 @@ class Site {
set_config('system','siteinfo',$siteinfo);
set_config('system', 'language', $language);
set_config('system', 'theme', $theme);
- if ( $theme_mobile === '---' ) {
- del_config('system', 'mobile_theme');
- } else {
- set_config('system', 'mobile_theme', $theme_mobile);
- }
+// if ( $theme_mobile === '---' ) {
+// del_config('system', 'mobile_theme');
+// } else {
+// set_config('system', 'mobile_theme', $theme_mobile);
+// }
// set_config('system','site_channel', $site_channel);
set_config('system','maximagesize', $maximagesize);
@@ -305,7 +305,7 @@ class Site {
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
- '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
+// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
'$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')),
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index 047bcf3d4..56e35f912 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -207,7 +207,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
}
}
- $imagedata = (($os_storage) ? @file_get_contents($imagedata) : $imagedata);
+ $imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata));
$ph = photo_factory($imagedata, $filetype);
if(! $ph->is_valid()) {
@@ -364,6 +364,12 @@ class Cover_photo extends \Zotlabs\Web\Controller {
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
'$embedPhotosModalOK' => t('OK'),
+ '$modalchooseimages' => t('Choose images to embed'),
+ '$modalchoosealbum' => t('Choose an album'),
+ '$modaldiffalbum' => t('Choose a different album'),
+ '$modalerrorlist' => t('Error getting album list'),
+ '$modalerrorlink' => t('Error getting photo link'),
+ '$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("cover_photo"),
/// @FIXME - yuk
'$select' => t('Select existing photo'),
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index 44b7c18c6..2ce8686b9 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -463,6 +463,12 @@ class Profile_photo extends \Zotlabs\Web\Controller {
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
'$embedPhotosModalOK' => t('OK'),
+ '$modalchooseimages' => t('Choose images to embed'),
+ '$modalchoosealbum' => t('Choose an album'),
+ '$modaldiffalbum' => t('Choose a different album'),
+ '$modalerrorlist' => t('Error getting album list'),
+ '$modalerrorlink' => t('Error getting photo link'),
+ '$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("profile_photo"),
'$select' => t('Select existing photo'),
));
diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php
index 93c2e4e3f..0b9204b9b 100644
--- a/Zotlabs/Update/_1204.php
+++ b/Zotlabs/Update/_1204.php
@@ -8,11 +8,11 @@ class _1204 {
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE poll ADD poll_guid text NOT NULL");
- $r2 = q("create index \"poll_guid_idx\" on poll \"poll_guid\"");
+ $r2 = q("create index \"poll_guid_idx\" on poll (\"poll_guid\")");
$r3 = q("ALTER TABLE poll_elm ADD pelm_guid text NOT NULL");
- $r4 = q("create index \"pelm_guid_idx\" on poll_elm \"pelm_guid\"");
+ $r4 = q("create index \"pelm_guid_idx\" on poll_elm (\"pelm_guid\")");
$r5 = q("ALTER TABLE vote ADD vote_guid text NOT NULL");
- $r6 = q("create index \"vote_guid_idx\" on vote \"vote_guid\"");
+ $r6 = q("create index \"vote_guid_idx\" on vote (\"vote_guid\")");
$r = ($r1 && $r2 && $r3 && $r4 && $r5 && $r6);
}
diff --git a/view/js/mod_cover_photo.js b/view/js/mod_cover_photo.js
deleted file mode 100644
index 5b64b8b91..000000000
--- a/view/js/mod_cover_photo.js
+++ /dev/null
@@ -1,80 +0,0 @@
- var initializeEmbedPhotoDialog = function () {
- $('.embed-photo-selected-photo').each(function (index) {
- $(this).removeClass('embed-photo-selected-photo');
- });
- getPhotoAlbumList();
- $('#embedPhotoModalBodyAlbumDialog').off('click');
- $('#embedPhotoModal').modal('show');
- };
-
- var choosePhotoFromAlbum = function (album) {
- $.post("embedphotos/album", {name: album},
- function(data) {
- if (data['status']) {
- $('#embedPhotoModalLabel').html("{{$modalchooseimages}}");
- $('#embedPhotoModalBodyAlbumDialog').html('\
- <div><div class="nav nav-pills flex-column">\n\
- <li class="nav-item"><a class="nav-link" href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
- <i class="fa fa-chevron-left"></i>&nbsp\n\
- {{$modaldiffalbum}}\n\
- </a>\n\
- </li>\n\
- </div><br></div>')
- $('#embedPhotoModalBodyAlbumDialog').append(data['content']);
- $('#embedPhotoModalBodyAlbumDialog').click(function (evt) {
- evt.preventDefault();
- var image = document.getElementById(evt.target.id);
- if (typeof($(image).parent()[0]) !== 'undefined') {
- var imageparent = document.getElementById($(image).parent()[0].id);
- $(imageparent).toggleClass('embed-photo-selected-photo');
- var href = $(imageparent).attr('href');
- $.post("embedphotos/photolink", {href: href},
- function(ddata) {
- if (ddata['status']) {
- window.location.href = 'cover_photo/use/' + ddata['resource_id'];
- } else {
- window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
- }
- return false;
- },
- 'json');
- $('#embedPhotoModalBodyAlbumDialog').html('');
- $('#embedPhotoModalBodyAlbumDialog').off('click');
- $('#embedPhotoModal').modal('hide');
- }
- });
-
- $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
- $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
- } else {
- window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
- }
- return false;
- },
- 'json');
- };
-
- var getPhotoAlbumList = function () {
- $.post("embedphotos/albumlist", {},
- function(data) {
- if (data['status']) {
- var albums = data['albumlist']; //JSON.parse(data['albumlist']);
- $('#embedPhotoModalLabel').html("{{$modalchoosealbum}}");
- $('#embedPhotoModalBodyAlbumList').html('<ul class="nav nav-pills flex-column"></ul>');
- for(var i=0; i<albums.length; i++) {
- var albumName = albums[i].text;
- var jsAlbumName = albums[i].jstext;
- var albumLink = '<li class="nav-item">';
- albumLink += '<a class="nav-link" href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>';
- albumLink += '</li>';
- $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
- }
- $('#embedPhotoModalBodyAlbumDialog').addClass('d-none');
- $('#embedPhotoModalBodyAlbumListDialog').removeClass('d-none');
- } else {
- window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']);
- }
- return false;
- },
- 'json');
- };
diff --git a/view/js/mod_profile_photo.js b/view/js/mod_profile_photo.js
deleted file mode 100644
index c05c8e25e..000000000
--- a/view/js/mod_profile_photo.js
+++ /dev/null
@@ -1,82 +0,0 @@
- var initializeEmbedPhotoDialog = function () {
- $('.embed-photo-selected-photo').each(function (index) {
- $(this).removeClass('embed-photo-selected-photo');
- });
- getPhotoAlbumList();
- $('#embedPhotoModalBodyAlbumDialog').off('click');
- $('#embedPhotoModal').modal('show');
- };
-
- var choosePhotoFromAlbum = function (album) {
- $.post("embedphotos/album", {name: album},
- function(data) {
- if (data['status']) {
- $('#embedPhotoModalLabel').html("{{$modalchooseimages}}");
- $('#embedPhotoModalBodyAlbumDialog').html('\
- <div><div class="nav nav-pills flex-column">\n\
- <li class="nav-item"><a class="nav-link" href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
- <i class="fa fa-chevron-left"></i>&nbsp\n\
- {{$modaldiffalbum}}\n\
- </a>\n\
- </li>\n\
- </div><br></div>')
- $('#embedPhotoModalBodyAlbumDialog').append(data['content']);
- $('#embedPhotoModalBodyAlbumDialog').click(function (evt) {
- evt.preventDefault();
- var image = document.getElementById(evt.target.id);
- if (typeof($(image).parent()[0]) !== 'undefined') {
- var imageparent = document.getElementById($(image).parent()[0].id);
- $(imageparent).toggleClass('embed-photo-selected-photo');
- var href = $(imageparent).attr('href');
- $.post("embedphotos/photolink", {href: href},
- function(ddata) {
- if (ddata['status']) {
- var pf = $('#profile-photo-profiles').val();
- var prof = ((typeof pf !== 'undefined') ? '?f=&pf=' + pf : '');
- window.location.href = 'profile_photo/use/' + ddata['resource_id'] + prof;
- } else {
- window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
- }
- return false;
- },
- 'json');
- $('#embedPhotoModalBodyAlbumDialog').html('');
- $('#embedPhotoModalBodyAlbumDialog').off('click');
- $('#embedPhotoModal').modal('hide');
- }
- });
-
- $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
- $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
- } else {
- window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
- }
- return false;
- },
- 'json');
- };
-
- var getPhotoAlbumList = function () {
- $.post("embedphotos/albumlist", {},
- function(data) {
- if (data['status']) {
- var albums = data['albumlist']; //JSON.parse(data['albumlist']);
- $('#embedPhotoModalLabel').html("{{$modalchoosealbum}}");
- $('#embedPhotoModalBodyAlbumList').html('<ul class="nav nav-pills flex-column"></ul>');
- for(var i=0; i<albums.length; i++) {
- var albumName = albums[i].text;
- var jsAlbumName = albums[i].jstext;
- var albumLink = '<li class="nav-item">';
- albumLink += '<a class="nav-link" href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>';
- albumLink += '</li>';
- $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
- }
- $('#embedPhotoModalBodyAlbumDialog').addClass('d-none');
- $('#embedPhotoModalBodyAlbumListDialog').removeClass('d-none');
- } else {
- window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']);
- }
- return false;
- },
- 'json');
- };
diff --git a/view/tpl/admin_settings_features.tpl b/view/tpl/admin_settings_features.tpl
index 2d5cf7e0b..86f978e08 100644
--- a/view/tpl/admin_settings_features.tpl
+++ b/view/tpl/admin_settings_features.tpl
@@ -9,12 +9,12 @@
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="{{$g}}-settings-title">
<h3>
- <a data-toggle="collapse" data-parent="#settings" href="#{{$g}}-settings-content" aria-expanded="true" aria-controls="{{$g}}-settings-collapse">
+ <a data-toggle="collapse" data-target="#{{$g}}-settings-content" href="#" aria-expanded="true" aria-controls="{{$g}}-settings-collapse">
{{$f.0}}
</a>
</h3>
</div>
- <div id="{{$g}}-settings-content" class="panel-collapse collapse{{if $g == 'general'}} in{{/if}}" role="tabpanel" aria-labelledby="{{$g}}-settings-title">
+ <div id="{{$g}}-settings-content" class="panel-collapse collapse{{if $g == 'general'}} show{{/if}}" data-parent="#settings" role="tabpanel" aria-labelledby="{{$g}}-settings-title">
<div class="section-content-tools-wrapper">
{{foreach $f.1 as $fcat}}
{{include file="field_checkbox.tpl" field=$fcat.0}}
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl
index 78e3ee245..10b367810 100755
--- a/view/tpl/admin_site.tpl
+++ b/view/tpl/admin_site.tpl
@@ -55,7 +55,7 @@
{{include file="field_select.tpl" field=$language}}
{{include file="field_select.tpl" field=$theme}}
- {{include file="field_select.tpl" field=$theme_mobile}}
+ {{* include file="field_select.tpl" field=$theme_mobile *}}
{{include file="field_input.tpl" field=$frontpage}}
{{include file="field_checkbox.tpl" field=$mirror_frontpage}}
{{include file="field_checkbox.tpl" field=$login_on_homepage}}
diff --git a/view/tpl/cover_photo.tpl b/view/tpl/cover_photo.tpl
index cbcf46320..829a3a556 100755
--- a/view/tpl/cover_photo.tpl
+++ b/view/tpl/cover_photo.tpl
@@ -1,3 +1,86 @@
+<script>
+ var initializeEmbedPhotoDialog = function () {
+ $('.embed-photo-selected-photo').each(function (index) {
+ $(this).removeClass('embed-photo-selected-photo');
+ });
+ getPhotoAlbumList();
+ $('#embedPhotoModalBodyAlbumDialog').off('click');
+ $('#embedPhotoModal').modal('show');
+ };
+
+ var choosePhotoFromAlbum = function (album) {
+ $.post("embedphotos/album", {name: album},
+ function(data) {
+ if (data['status']) {
+ $('#embedPhotoModalLabel').html("{{$modalchooseimages}}");
+ $('#embedPhotoModalBodyAlbumDialog').html('\
+ <div><div class="nav nav-pills flex-column">\n\
+ <li class="nav-item"><a class="nav-link" href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
+ <i class="fa fa-chevron-left"></i>&nbsp\n\
+ {{$modaldiffalbum}}\n\
+ </a>\n\
+ </li>\n\
+ </div><br></div>')
+ $('#embedPhotoModalBodyAlbumDialog').append(data['content']);
+ $('#embedPhotoModalBodyAlbumDialog').click(function (evt) {
+ evt.preventDefault();
+ var image = document.getElementById(evt.target.id);
+ if (typeof($(image).parent()[0]) !== 'undefined') {
+ var imageparent = document.getElementById($(image).parent()[0].id);
+ $(imageparent).toggleClass('embed-photo-selected-photo');
+ var href = $(imageparent).attr('href');
+ $.post("embedphotos/photolink", {href: href},
+ function(ddata) {
+ if (ddata['status']) {
+ window.location.href = 'cover_photo/use/' + ddata['resource_id'];
+ } else {
+ window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ $('#embedPhotoModalBodyAlbumDialog').html('');
+ $('#embedPhotoModalBodyAlbumDialog').off('click');
+ $('#embedPhotoModal').modal('hide');
+ }
+ });
+
+ $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
+ $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
+ } else {
+ window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ };
+
+ var getPhotoAlbumList = function () {
+ $.post("embedphotos/albumlist", {},
+ function(data) {
+ if (data['status']) {
+ var albums = data['albumlist']; //JSON.parse(data['albumlist']);
+ $('#embedPhotoModalLabel').html("{{$modalchoosealbum}}");
+ $('#embedPhotoModalBodyAlbumList').html('<ul class="nav nav-pills flex-column"></ul>');
+ for(var i=0; i<albums.length; i++) {
+ var albumName = albums[i].text;
+ var jsAlbumName = albums[i].jstext;
+ var albumLink = '<li class="nav-item">';
+ albumLink += '<a class="nav-link" href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>';
+ albumLink += '</li>';
+ $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
+ }
+ $('#embedPhotoModalBodyAlbumDialog').addClass('d-none');
+ $('#embedPhotoModalBodyAlbumListDialog').removeClass('d-none');
+ } else {
+ window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ };
+</script>
+
<div id="profile-photo-content" class="generic-content-wrapper">
<div class="section-title-wrapper">
<h2>{{$title}}</h2>
diff --git a/view/tpl/profile_edit.tpl b/view/tpl/profile_edit.tpl
index 05137479f..95183fdf4 100755
--- a/view/tpl/profile_edit.tpl
+++ b/view/tpl/profile_edit.tpl
@@ -49,12 +49,12 @@
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="personal">
<h3>
- <a data-toggle="collapse" data-parent="#profile-edit-wrapper" href="#personal-collapse" aria-expanded="true" aria-controls="personal-collapse">
+ <a data-toggle="collapse" data-target="#personal-collapse" href="#" aria-expanded="true" aria-controls="personal-collapse">
{{$personal}}
</a>
</h3>
</div>
- <div id="personal-collapse" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="personal">
+ <div id="personal-collapse" class="panel-collapse collapse show" data-parent="#profile-edit-wrapper" role="tabpanel" aria-labelledby="personal">
<div class="section-content-tools-wrapper">
{{include file="field_input.tpl" field=$profile_name}}
@@ -215,12 +215,12 @@
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="location">
<h3>
- <a data-toggle="collapse" data-parent="#profile-edit-wrapper" href="#location-collapse" aria-expanded="true" aria-controls="location-collapse">
+ <a data-toggle="collapse" data-target="#location-collapse" href="#" aria-expanded="true" aria-controls="location-collapse">
{{$location}}
</a>
</h3>
</div>
- <div id="location-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="location">
+ <div id="location-collapse" class="panel-collapse collapse" data-parent="#profile-edit-wrapper" role="tabpanel" aria-labelledby="location">
<div class="section-content-tools-wrapper">
{{if $fields.address}}
{{include file="field_input.tpl" field=$address}}
@@ -260,12 +260,12 @@
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="relation">
<h3>
- <a data-toggle="collapse" data-parent="#profile-edit-wrapper" href="#relation-collapse" aria-expanded="true" aria-controls="relation-collapse">
+ <a data-toggle="collapse" data-target="#relation-collapse" href="#" aria-expanded="true" aria-controls="relation-collapse">
{{$relation}}
</a>
</h3>
</div>
- <div id="relation-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="relation">
+ <div id="relation-collapse" class="panel-collapse collapse" data-parent="#profile-edit-wrapper" role="tabpanel" aria-labelledby="relation">
<div class="section-content-tools-wrapper">
{{if $fields.marital }}
<div id="profile-edit-marital-wrapper" class="form-group field" >
@@ -307,12 +307,12 @@
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="miscellaneous">
<h3>
- <a data-toggle="collapse" data-parent="#profile-edit-wrapper" href="#miscellaneous-collapse" aria-expanded="true" aria-controls="miscellaneous-collapse">
+ <a data-toggle="collapse" data-target="#miscellaneous-collapse" href="#" aria-expanded="true" aria-controls="miscellaneous-collapse">
{{$miscellaneous}}
</a>
</h3>
</div>
- <div id="miscellaneous-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="miscellaneous">
+ <div id="miscellaneous-collapse" class="panel-collapse collapse" data-parent="#profile-edit-wrapper" role="tabpanel" aria-labelledby="miscellaneous">
<div class="section-content-tools-wrapper">
{{if $fields.homepage}}
{{include file="field_input.tpl" field=$homepage}}
diff --git a/view/tpl/profile_photo.tpl b/view/tpl/profile_photo.tpl
index edde6af3f..e48d05330 100755
--- a/view/tpl/profile_photo.tpl
+++ b/view/tpl/profile_photo.tpl
@@ -1,3 +1,89 @@
+<script>
+ var initializeEmbedPhotoDialog = function () {
+ $('.embed-photo-selected-photo').each(function (index) {
+ $(this).removeClass('embed-photo-selected-photo');
+ });
+ getPhotoAlbumList();
+ $('#embedPhotoModalBodyAlbumDialog').off('click');
+ $('#embedPhotoModal').modal('show');
+ };
+
+ var choosePhotoFromAlbum = function (album) {
+ $.post("embedphotos/album", {name: album},
+ function(data) {
+ if (data['status']) {
+ $('#embedPhotoModalLabel').html("{{$modalchooseimages}}");
+ $('#embedPhotoModalBodyAlbumDialog').html('\
+ <div><div class="nav nav-pills flex-column">\n\
+ <li class="nav-item"><a class="nav-link" href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
+ <i class="fa fa-chevron-left"></i>&nbsp\n\
+ {{$modaldiffalbum}}\n\
+ </a>\n\
+ </li>\n\
+ </div><br></div>')
+ $('#embedPhotoModalBodyAlbumDialog').append(data['content']);
+ $('#embedPhotoModalBodyAlbumDialog').click(function (evt) {
+ evt.preventDefault();
+ var image = document.getElementById(evt.target.id);
+ if (typeof($(image).parent()[0]) !== 'undefined') {
+ var imageparent = document.getElementById($(image).parent()[0].id);
+ $(imageparent).toggleClass('embed-photo-selected-photo');
+ var href = $(imageparent).attr('href');
+ $.post("embedphotos/photolink", {href: href},
+ function(ddata) {
+ if (ddata['status']) {
+ var pf = $('#profile-photo-profiles').val();
+ var prof = ((typeof pf !== 'undefined') ? '?f=&pf=' + pf : '');
+ window.location.href = 'profile_photo/use/' + ddata['resource_id'] + prof;
+ } else {
+ window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ $('#embedPhotoModalBodyAlbumDialog').html('');
+ $('#embedPhotoModalBodyAlbumDialog').off('click');
+ $('#embedPhotoModal').modal('hide');
+ }
+ });
+
+ $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
+ $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
+ } else {
+ window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ };
+
+ var getPhotoAlbumList = function () {
+ $.post("embedphotos/albumlist", {},
+ function(data) {
+ if (data['status']) {
+ var albums = data['albumlist']; //JSON.parse(data['albumlist']);
+ $('#embedPhotoModalLabel').html("{{$modalchoosealbum}}");
+ $('#embedPhotoModalBodyAlbumList').html('<ul class="nav nav-pills flex-column"></ul>');
+ for(var i=0; i<albums.length; i++) {
+ var albumName = albums[i].text;
+ var jsAlbumName = albums[i].jstext;
+ var albumLink = '<li class="nav-item">';
+ albumLink += '<a class="nav-link" href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>';
+ albumLink += '</li>';
+ $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
+ }
+ $('#embedPhotoModalBodyAlbumDialog').addClass('d-none');
+ $('#embedPhotoModalBodyAlbumListDialog').removeClass('d-none');
+ } else {
+ window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']);
+ }
+ return false;
+ },
+ 'json');
+ };
+</script>
+
+
<div id="profile-photo-content" class="generic-content-wrapper">
<div class="section-title-wrapper">
<h2>{{$title}}</h2>