Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/unaio/una
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Oct 13, 2021
2 parents 3931011 + e04f6c9 commit a6f972f
Show file tree
Hide file tree
Showing 27 changed files with 22,838 additions and 48 deletions.
94 changes: 94 additions & 0 deletions inc/js/editor.quill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup UnaCore UNA Core
* @{
*/

function bx_editor_insert_html (sEditorId, sImgId, sHtml) {

var eEditor = 'object' == typeof(quill) ? quill.get(sEditorId) : undefined;
if ('undefined' == typeof(eEditor))
return;

if (eEditor.dom && eEditor.dom.doc && eEditor.dom.doc.getElementById(sImgId))
return;

eEditor.execCommand('mceInsertContent', false, sHtml);
}

function bx_editor_insert_img (sEditorId, sImgId, sImgUrl, sClasses) {

if ('undefined' == typeof(sClasses))
sClasses = '';

bx_editor_insert_html(sEditorId, sImgId, '<img id="' + sImgId + '" class="' + sClasses + '" src="' + sImgUrl + '" />')
}

function bx_editor_on_init (sEditorId)
{
if (typeof glOnInitEditor !== 'undefined' && glOnInitEditor instanceof Array) {
for (var i = 0; i < glOnInitEditor.length; i++)
if (typeof glOnInitEditor[i] === "function")
glOnInitEditor[i](sEditorId);
}
}

function bx_editor_on_space_enter (sEditorId)
{
// TODO:
}

function bx_editor_remove_img (aEditorIds, aMarkers) {
if ('object' != typeof(quill))
return;

var aEditors = [];
for (var i = 0; i < aEditorIds.length; i++)
aEditors.push(quill.get(aEditorIds[i]));

for (var j = 0; j < aEditors.length; j++) {
var eEditor = aEditors[j];
if (typeof(eEditor) != 'object' || null === eEditor || typeof(eEditor.dom) != 'object' || typeof(eEditor.dom.doc) != 'object')
continue;

// delete images in html editor
for (var k = 0; k < aMarkers.length; k++) {
var jFiles = $(eEditor.dom.doc).find(aMarkers[k]);
jFiles.each(function () {
eEditor.execCommand('mceRemoveNode', false, this);
});
}
}
}

function bx_editor_get_htmleditable (sEditorSelector)
{
if (!$(sEditorSelector).size())
return false;

var sId = $(sEditorSelector).attr('id');

var eEditor = 'object' == typeof(quill) ? quill.get(sId) : undefined;
if ('undefined' == typeof(eEditor) || !eEditor.dom)
return false;

return $(eEditor.dom.doc).find('body').get(0);
}

function bx_editor_remove_all (oElement)
{
if ('undefined' == typeof(oElement))
oElement = window;
oElement = $(oElement);

if ('undefined' == typeof(quill) || !quill.editors.length)
return;
$.each(quill.editors, function () {
if ($(this.getElement()).parents().filter(oElement).length)
this.remove();
});
}

/** @} */
5 changes: 5 additions & 0 deletions inc/utils.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,11 @@ function bx_file_get_contents($sFileUrl, $aParams = array(), $sMethod = 'get', $
curl_setopt($rConnect, CURLOPT_CONNECTTIMEOUT, $iTimeout);
curl_setopt($rConnect, CURLOPT_TIMEOUT, $iTimeout);
}

if(getParam('curl_ssl_allow_untrusted') == 'on'){
curl_setopt($rConnect, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rConnect, CURLOPT_SSL_VERIFYHOST, false);
}

if (!ini_get('open_basedir'))
curl_setopt($rConnect, CURLOPT_FOLLOWLOCATION, 1);
Expand Down
12 changes: 10 additions & 2 deletions install/sql/system.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ CREATE TABLE `sys_objects_editor` (


INSERT INTO `sys_objects_editor` (`object`, `title`, `skin`, `override_class_name`, `override_class_file`) VALUES
('sys_tinymce', 'TinyMCE', 'lightgray', 'BxTemplEditorTinyMCE', '');
('sys_tinymce', 'TinyMCE', 'lightgray', 'BxTemplEditorTinyMCE', ''),
('sys_quill', 'Quill', 'snow', 'BxTemplEditorQuill', '');


-- --------------------------------------------------------
Expand Down Expand Up @@ -339,7 +340,14 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex

(@iCategoryId, 'sys_logs_storage_default', '_adm_stg_cpt_option_sys_logs_storage_default', 'Folder', 'select', 'Folder,PHPLog,STDErr', '', '', '', 130),

(@iCategoryId, 'sys_default_curl_timeout', '_adm_stg_cpt_option_sys_default_curl_timeout', '300', 'digit', '', '', '', '', 140);
(@iCategoryId, 'sys_default_curl_timeout', '_adm_stg_cpt_option_sys_default_curl_timeout', '300', 'digit', '', '', '', '', 140),
(@iCategoryId, 'curl_ssl_allow_untrusted', '_adm_stg_cpt_option_sys_ssl_allow_untrusted', '', 'checkbox', '', '', '', '', 145),

(@iCategoryId, 'sys_quill_toolbar_mini', '_adm_stg_cpt_option_sys_quill_toolbar_mini', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'}],[\'blockquote\'],[\'link\',\'image\']', 'digit', '', '', '', '', 150),
(@iCategoryId, 'sys_quill_toolbar_standard', '_adm_stg_cpt_option_sys_quill_toolbar_standard', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},{\'align\':\'justify\'}],[\'blockquote\'],[\'link\',\'image\']', 'digit', '', '', '', '', 153),
(@iCategoryId, 'sys_quill_toolbar_full', '_adm_stg_cpt_option_sys_quill_toolbar_full', '[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[{ \'font\': [] }],[\'bold\',\'italic\',\'underline\',\'clean\'],
[{ \'align\': [] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[\'blockquote\'],[{ \'color\': [] }, { \'background\': [] }],[{ \'direction\': \'rtl\' }],[{ \'script\': \'sub\'}, { \'script\': \'super\' }],[\'link\',\'image\',\'code-block\']', 'digit', '', '', '', '', 156);


--
-- CATEGORY (HIDDEN): System
Expand Down
8 changes: 6 additions & 2 deletions modules/base/profile/classes/BxBaseModProfileMenuViewMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ protected function _getMenuItemMembership($aItem)
if(!$this->_bContentPublic || !$this->_oContentProfile)
return false;

$aMembership = BxDolAcl::getInstance()->getMemberMembershipInfo($this->_oContentProfile->id());
return $aMembership ? $this->getUnitMetaItemText(_t($aMembership['name'])) : false;
$oAcl = BxDolAcl::getInstance();
$oTemplate = BxDolTemplate::getInstance();
$aMembership = $oAcl->getMemberMembershipInfo($this->_oContentProfile->id());
$aLevelInfo = $oAcl->getMembershipInfo($aMembership['id']);
return $aMembership ? $this->getUnitMetaItemText($oTemplate->parseHtmlByName('menu_meta_item.html', ['icon' => $oTemplate->getImage($aLevelInfo['icon'], array('class' => 'bx-acl-m-thumbnail')), 'caption' => _t($aMembership['name'])])): false;

}

protected function _getMenuItemBadges($aItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function _setConditionsForRecommended ()

protected function _setAclConditions ($aParams)
{
$oAcl = BxDolAcl::getInstance();
$oAcl = BxDolAcl::getInstance();
if(!$oAcl || empty($aParams['level']))
return false;

Expand Down
17 changes: 8 additions & 9 deletions modules/base/profile/classes/BxBaseModProfileTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function prepareCover($aData, $oPage)
'content_id' => $aData[$CNF['FIELD_ID']],
'uploader' => $CNF['OBJECT_UPLOADERS_PICTURE'][0],
'storage' => $CNF['OBJECT_STORAGE'],
'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_THUMB'],
'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_AVATAR_BIG'],
'field' => $CNF['FIELD_PICTURE'],
'is_background' => false,
'add_class' => &$sAddClassPicture,
Expand Down Expand Up @@ -369,19 +369,18 @@ function prepareCover($aData, $oPage)

$aShowAvatar = array(
'add_class' => $sAddClassPicture,
'letter' => mb_substr($sTitle, 0, 1),
'img_class' => $sAddClassPicture != '' ? 'bx-media-editable-src' : '',
'ava_url' => $sUrlAvatar,
'color' => implode(', ', BxDolTemplate::getColorCode($iProfile, 1.0)),

'bx_if:show_ava_image' => array(
'condition' => $bUrlAvatar,
'content' => array(
'ava_url' => $sUrlAvatar,
'img_class' => $sAddClassPicture != '' ? 'bx-media-editable-src' : '',
)
'content' => array()
),
'bx_if:show_ava_letter' => array(
'condition' => !$bUrlAvatar,
'content' => array(
'color' => implode(', ', BxDolTemplate::getColorCode($iProfile, 1.0)),
'letter' => mb_substr($sTitle, 0, 1)
)
'content' => array()
),
'bx_if:show_online' => array(
'condition' => $oProfile->isOnline(),
Expand Down
8 changes: 2 additions & 6 deletions modules/base/profile/template/cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
<bx_if:show_avatar>
<div class="bx-base-pofile-cover-thumb __add_class__">
<a class="bx-base-pofile-cover-thumb" href="__picture_href__" onclick="$('#__picture_popup_id__').dolPopupImage('__picture_url__', $(this).parent()); event.stopPropagation();">
<bx_if:show_ava_image>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size __img_class__" src="__ava_url__" />
</bx_if:show_ava_image>
<bx_if:show_ava_letter>
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size bx-def-border" style="background-color:rgba(__color__)">__letter__</p>
</bx_if:show_ava_letter>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size __img_class__" src="__ava_url__" <bx_if:show_ava_letter> style="display:none" </bx_if:show_ava_letter> />
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size bx-def-border" style="background-color:rgba(__color__);<bx_if:show_ava_image>display:none</bx_if:show_ava_image>">__letter__</p>
</a>
<bx_if:show_online>
<div class="bx-base-pofile-unit-online"></div>
Expand Down
8 changes: 2 additions & 6 deletions modules/base/profile/template/cover_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
<bx_if:show_avatar>
<div class="bx-base-pofile-cover-thumb __add_class__">
<a class="bx-base-pofile-cover-thumb" href="__picture_href__" onclick="$('#__picture_popup_id__').dolPopupImage('__picture_url__', $(this).parent()); event.stopPropagation();">
<bx_if:show_ava_image>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size __img_class__" src="__ava_url__" />
</bx_if:show_ava_image>
<bx_if:show_ava_letter>
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size bx-def-border" style="background-color:rgba(__color__)">__letter__</p>
</bx_if:show_ava_letter>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size __img_class__" src="__ava_url__" <bx_if:show_ava_letter> style="display:none" </bx_if:show_ava_letter> />
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size bx-def-border" style="background-color:rgba(__color__);<bx_if:show_ava_image>display:none</bx_if:show_ava_image>" >__letter__</p>
</a>
<bx_if:show_online>
<div class="bx-base-pofile-unit-online"></div>
Expand Down
2 changes: 1 addition & 1 deletion modules/base/text/classes/BxBaseModTextTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function getTmplVarsText($aData)
'content_id' => $aData[$CNF['FIELD_ID']],
'uploader' => $CNF['OBJECT_UPLOADERS'][0],
'storage' => $CNF['OBJECT_STORAGE'],
'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW'],
'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_COVER'],
'field' => $CNF['FIELD_THUMB'],
'is_background' => false,
'add_class' => &$sAddClassPicture,
Expand Down
10 changes: 3 additions & 7 deletions modules/boonex/artificer/data/template/mod_profile/cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@
<div class="bx-base-pofile-cover-info bx-def-page-width relative mx-auto px-6 lg:px-8">
<div class="bx-base-pofile-ci-cnt relative flex flex-col -mt-24 lg:-mt-16 lg:flex-row lg:items-center">
<bx_if:show_avatar>
<div class="bx-base-pofile-cover-thumb lg:absolute flex justify-center lg:flex-none __add_class__">
<div class="bx-base-pofile-cover-thumb lg:absolute flex justify-center lg:flex-none z-10 __add_class__">
<a class="bx-base-pofile-cover-thumb" href="__picture_href__" onclick="$('#__picture_popup_id__').dolPopupImage('__picture_url__', $(this).parent()); event.stopPropagation();">
<bx_if:show_ava_image>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 __img_class__" src="__ava_url__" />
</bx_if:show_ava_image>
<bx_if:show_ava_letter>
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size flex items-center justify-center box-border m-0 rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 text-white font-bold text-5xl" style="background-color:rgba(__color__)">__letter__</p>
</bx_if:show_ava_letter>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 __img_class__" src="__ava_url__" <bx_if:show_ava_letter> style="display:none" </bx_if:show_ava_letter> />
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size flex items-center justify-center box-border m-0 rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 text-white font-bold text-5xl __img_class__-placeholder" style="background-color:rgba(__color__);<bx_if:show_ava_image>display:none</bx_if:show_ava_image>" >__letter__</p>
</a>
<bx_if:show_online>
<div class="bx-base-pofile-unit-online"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@
<div class="absolute top-6 -left-1/4 w-2/3 h-2/3 bg-blue-700 filter blur-3xl z-0 opacity-50 animate-goo"></div>
<div class="absolute top-6 -right-1/4 w-2/3 h-2/3 bg-green-700 filter blur-3xl z-0 opacity-50 animate-goo"></div>
</div>
<div class="bx-base-pofile-cover-image relative max-w-7xl mx-auto opacity-100">
<a class="bx-base-pofile-cover-image box-border" href="__cover_href__" onclick="$('#__cover_popup_id__').dolPopupImage('__cover_url__', this)">
<img class="bx-base-pofile-cover-image h-64 mx-auto w-full object-cover lg:h-40 rounded z-10" src="__cover_url__" />
<div class="bx-base-pofile-cover-image relative h-64 lg:h-40 max-w-7xl mx-auto opacity-100 __add_class__">
<a class="bx-base-pofile-cover-image box-border absolute h-full w-full" href="__cover_href__" onclick="$('#__cover_popup_id__').dolPopupImage('__cover_url__', this)">
<img class="bx-base-pofile-cover-image h-64 mx-auto w-full object-cover bg-cover lg:h-40 rounded z-10 __img_class__" style="background-image:url(__cover_url__)" src="<bx_icon_url:spacer.gif />" />
</a>
</div>
</div>
<div class="bx-base-pofile-cover-info relative mx-auto px-6 ">
<div class="bx-base-pofile-ci-cnt relative flex flex-col -mt-16 ">
<bx_if:show_avatar>
<div class="bx-base-pofile-cover-thumb flex justify-center ">
<a class="bx-base-pofile-cover-thumb" href="__picture_href__" onclick="$('#__picture_popup_id__').dolPopupImage('__picture_url__', $(this).parent()); event.stopPropagation();">
<bx_if:show_ava_image>
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 lg:h-32 lg:w-32" src="__ava_url__" />
</bx_if:show_ava_image>
<bx_if:show_ava_letter>
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size flex items-center justify-center box-border m-0 rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 lg:h-32 lg:w-32 text-white font-bold text-5xl" style="background-color:rgba(__color__)">__letter__</p>
</bx_if:show_ava_letter>
<div class="bx-base-pofile-cover-thumb flex justify-center __add_class__">
<a class="bx-base-pofile-cover-thumb" href="__picture_href__" onclick="$('#__picture_popup_id__').dolPopupImage('__picture_url__', $(this).parent()); event.stopPropagation();">
<img class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 lg:h-32 lg:w-32 __img_class__" src="__ava_url__" <bx_if:show_ava_letter> style="display:none" </bx_if:show_ava_letter> />
<p class="bx-base-pofile-unit-thumb bx-def-ava-big bx-def-ava-big-size flex items-center justify-center box-border m-0 rounded-full ring-4 mx-auto ring-white dark:ring-gray-900 h-48 w-48 lg:h-32 lg:w-32 text-white font-bold text-5xl __img_class__-placeholder" style="background-color:rgba(__color__);<bx_if:show_ava_image>display:none</bx_if:show_ava_image>" >__letter__</p>
</a>
<bx_if:show_online>
<div class="bx-base-pofile-unit-online"></div>
Expand Down Expand Up @@ -50,4 +46,5 @@ <h1 class="bx-def-unit-info text-4xl font-bold text-gray-900 dark:text-gray-50 t
</div>
__cover_popup__
__picture_popup__
</div>
</div>
__additional_code__
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<bx_if:span>
<span class="__style_prefix__-div text-sm text-gray-500 dark:text-gray-400">&nbsp;&#183;&nbsp;</span>
<span class="bx-base-profile-unit-meta-item">
<span class="text-sm text-gray-500 dark:text-gray-400 __class__" <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</span>
</span>
</bx_if:span>
<bx_if:a>
<span class="__style_prefix__-div text-sm text-gray-500 dark:text-gray-400">&nbsp;&#183;&nbsp;</span>
<span class="bx-base-profile-unit-meta-item"><a class="__class__" <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a></span>
</bx_if:a>
<bx_if:button>
<span class="bx-base-profile-unit-meta-item px-1"><a class="bx-btn __class__" <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a></span>
</bx_if:button>
<bx_if:sbutton>
<span class="bx-base-profile-unit-meta-item px-1">
<a class="bx-btn bx-btn-small __class__" <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a>
</span>
</bx_if:sbutton>
<bx_if:custom><span class="bx-base-profile-unit-meta-item">__content__</span></bx_if:custom>
<bx_if:nl></bx_if:nl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php defined('BX_DOL') or die('hack attempt');
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup UnaTemplate UNA Template Classes
* @{
*/

/**
* @see BxDolEditor
*/
class BxTemplEditorQuill extends BxBaseEditorQuill
{
public function __construct ($aObject, $oTemplate = false)
{
parent::__construct ($aObject, $oTemplate);
}
}

/** @} */
Loading

0 comments on commit a6f972f

Please sign in to comment.