Файловый менеджер - Редактировать - /var/www/html/administrator/components/com_community/views/configuration/view.html.php
Ðазад
<?php /** * @copyright (C) 2013 iJoomla, Inc. - All rights reserved. * @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html) * @author iJoomla.com <webmaster@ijoomla.com> * @url https://www.jomsocial.com/license-agreement * The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0 * More info at https://www.jomsocial.com/license-agreement */ use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Uri\Uri; // Disallow direct access to this file defined('_JEXEC') or die('Restricted access'); jimport( 'joomla.application.component.view' ); jimport( 'joomla.filesystem.folder' ); jimport( 'joomla.filesystem.file' ); /** * Configuration view for JomSocial */ class CommunityViewConfiguration extends HtmlView { /** * The default method that will display the output of this view which is called by * Joomla * * @param string template Template file name **/ public function display( $tpl = null ) { $document = Factory::getDocument(); $params = $this->get( 'Params' ); //user's email privacy setting //CFactory::load( 'libraries' , 'notificationtypes' ); $notificationTypes = new CNotificationTypes(); $lists = array(); for ($i=1; $i<=31; $i++) { $qscale[] = HTMLHelper::_('select.option', $i, $i); } $lists['qscale'] = HTMLHelper::_('select.genericlist', $qscale, 'qscale', 'class="inputbox" size="1"', 'value', 'text', $params->get('qscale', '11')); $videosSize = array ( HTMLHelper::_('select.option', '320x240', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION1')), HTMLHelper::_('select.option', '320x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION2')), HTMLHelper::_('select.option', '400x240', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION3')), HTMLHelper::_('select.option', '400x300', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION4')), HTMLHelper::_('select.option', '400x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION5')), HTMLHelper::_('select.option', '480x272', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION6')), HTMLHelper::_('select.option', '480x320', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION7')), HTMLHelper::_('select.option', '480x360', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION8')), HTMLHelper::_('select.option', '480x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION9')), HTMLHelper::_('select.option', '512x384', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION10')), HTMLHelper::_('select.option', '512x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION11')), HTMLHelper::_('select.option', '600x480', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION12')), HTMLHelper::_('select.option', '600x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION13')), HTMLHelper::_('select.option', '640x360', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION14')), HTMLHelper::_('select.option', '640x480', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION15')), HTMLHelper::_('select.option', '640x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION16')), HTMLHelper::_('select.option', '800x600', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION17')), HTMLHelper::_('select.option', '800x???', Text::_('COM_COMMUNITY_VIDEO_SIZE_OPTION18')), ); $lists['videosSize'] = HTMLHelper::_('select.genericlist', $videosSize, 'videosSize', 'class="inputbox" size="1"', 'value', 'text', $params->get('videosSize')); $imgQuality = array ( HTMLHelper::_('select.option', '60', Text::_('COM_COMMUNITY_PHOTO_QUALITY_OPTION1')), HTMLHelper::_('select.option', '80', Text::_('COM_COMMUNITY_PHOTO_QUALITY_OPTION2')), HTMLHelper::_('select.option', '90', Text::_('COM_COMMUNITY_PHOTO_QUALITY_OPTION3')), HTMLHelper::_('select.option', '100', Text::_('COM_COMMUNITY_PHOTO_QUALITY_OPTION4')), ); $lists['imgQuality'] = HTMLHelper::_('select.genericlist', $imgQuality, 'output_image_quality', 'class="inputbox" size="1"', 'value', 'text', $params->get('output_image_quality')); //album mode $albumMode = array ( HTMLHelper::_('select.option', '0', Text::_('COM_COMMUNITY_SAME_WINDOW') ), // same window HTMLHelper::_('select.option', '1', Text::_('COM_COMMUNITY_MODAL_WINDOW')), // new window ); $lists['albumMode'] = HTMLHelper::_('select.genericlist', $albumMode, 'album_mode', 'class="inputbox" size="1"', 'value', 'text', $params->get('album_mode')); //video mode $videoMode = array ( HTMLHelper::_('select.option', '0', Text::_('COM_COMMUNITY_SAME_WINDOW') ), // same window HTMLHelper::_('select.option', '1', Text::_('COM_COMMUNITY_MODAL_WINDOW')), // new window ); $lists['videoMode'] = HTMLHelper::_('select.genericlist', $videoMode, 'video_mode', 'class="inputbox" size="1"', 'value', 'text', $params->get('video_mode')); //video native $videoNative = array ( HTMLHelper::_('select.option', '0', Text::_('COM_COMMUNITY_STREAM_VIDEO_PLAYER_MEDIAELEMENT') ), HTMLHelper::_('select.option', '1', Text::_('COM_COMMUNITY_STREAM_VIDEO_PLAYER_NATIVE')), ); $lists['videoNative'] = HTMLHelper::_('select.genericlist', $videoNative, 'video_native', 'class="inputbox" size="1"', 'value', 'text', $params->get('video_native')); // Group discussion order option $groupDiscussionOrder = array( HTMLHelper::_('select.option', 'ASC', Text::_('COM_COMMUNITY_SORT_OLDER_FRIST')), HTMLHelper::_('select.option', 'DESC', Text::_('COM_COMMUNITY_SORT_NEWER_FRIST')), ); $lists['groupDicussOrder'] = HTMLHelper::_('select.genericlist', $groupDiscussionOrder, 'group_discuss_order', 'class="inputbox" size="1"', 'value', 'text', $params->get('group_discuss_order')); $videoThumbSize = array( HTMLHelper::_('select.option','320x180','320x180'), HTMLHelper::_('select.option', '640x360', '640x360'), HTMLHelper::_('select.option', '1280x720', '1280x720'), ); $lists['videoThumbSize'] = HTMLHelper::_('select.genericlist', $videoThumbSize, 'videosThumbSize', 'class="inputbox" size="1"', 'value', 'text', $params->get('videosThumbSize')); $dstOffset = array(); $counter = -4; for($i=0; $i <= 8; $i++ ){ $dstOffset[] = HTMLHelper::_('select.option', $counter, $counter); $counter++; } $watermarkPosition = array( HTMLHelper::_('select.option', 'left_top', Text::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_LFFT_TOP')), HTMLHelper::_('select.option', 'left_bottom', Text::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_LFFT_BOTTOM')), HTMLHelper::_('select.option', 'right_top', Text::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_RIGHT_TOP')), HTMLHelper::_('select.option', 'right_bottom', Text::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_RIGHT_BOTTOM')) ); $lists['watermarkPosition'] = HTMLHelper::_('select.genericlist', $watermarkPosition, 'watermark_position', 'class="inputbox" size="1"', 'value', 'text', $params->get('watermark_position')); $lists['dstOffset'] = HTMLHelper::_('select.genericlist', $dstOffset, 'daylightsavingoffset', 'class="inputbox" size="1"', 'value', 'text', $params->get('daylightsavingoffset')); $networkModel = $this->getModel( 'network' , false ); $JSNInfo = $networkModel->getJSNInfo(); $JSON_output = $networkModel->getJSON(); $lists['enable'] = HTMLHelper::_('select.booleanlist', 'network_enable', 'class="inputbox"', $JSNInfo['network_enable'] ); $uploadLimit = ini_get('upload_max_filesize'); $uploadLimit = CString::str_ireplace('M', ' MB', $uploadLimit); require_once( JPATH_ROOT.'/administrator/components/com_community/libraries/autoupdate.php' ); $isuptodate = CAutoUpdate::checkUpdate(); $this->set( 'JSNInfo', $JSNInfo ); $this->set( 'JSON_output', $JSON_output ); $this->set( 'lists', $lists ); $this->set( 'uploadLimit' , $uploadLimit ); $this->set( 'config' , $params ); $this->set( 'isuptodate' , $isuptodate ); $this->set('notificationTypes',$notificationTypes); jimport('joomla.html.editor'); $config = CFactory::getConfig(); $editor = $editor = new CEditor('jomsocial'); $this->set('editor', $editor); parent::display($tpl); } public function getTemplatesList( $name , $default = '' ) { $path = dirname(JPATH_BASE) . '/components/com_community/templates'; if( $handle = @opendir($path) ) { while( false !== ( $file = readdir( $handle ) ) ) { // Do not get '.' or '..' or '.svn' since we only want folders. if( $file != '.' && $file != '..' && $file != '.svn' && is_file( $path .'/'. $file) ) $templates[] = $file; } } $html = '<select name="' . $name . '">'; foreach( $templates as $template ) { if( $template ) if( !empty( $default ) ) { $selected = ( $default == $template ) ? ' selected="true"' : ''; } $html .= '<option value="' . $template . '"' . $selected . '>' . $template . '</option>'; } $html .= '</select>'; return $html; } public function getKarmaHTML( $name , $value, $readonly=false, $updateTarget='') { $isReadOnly = ($readonly) ? ' readonly="readonly"' : ''; $requiredTargetUpdate = (! empty($updateTarget)) ? 'onblur="azcommunity.updateField(\''.$name.'\', \''.$updateTarget.'\')"' : ''; $html = '<table>'; $html .= '<tr>'; $html .= ' <td>'; if ($readonly) { $html .= '<span class="karma_readonly" id="' . $name . '">' . $value . '</span> '; } else { $html .= '<input type="text" value="' . $value . '" name="' . $name . '" id="'.$name.'" '.$isReadOnly.' '.$requiredTargetUpdate.' /> '; } // $html .= Text::_('COM_COMMUNITY_CONFIGURATION_KARMA_USE_IMAGE'); $html .= ' </td>'; $html .= ' <td>'; $html .= ' <img class="com_karmaImage" src="' . $this->_getKarmaImage( $name ) . '" />'; $html .= ' </td>'; $html .= '</tr>'; $html .= '</table>'; return $html; } public function getNotifyTypeHTML( $selected ) { $types = array(); $types[] = array( 'key' => '1' , 'value' => Text::_('COM_COMMUNITY_EMAIL') ); $types[] = array( 'key' => '2' , 'value' => Text::_('COM_COMMUNITY_PRIVATE_MESSAGE') ); $html = '<select name="notifyby">'; foreach( $types as $type => $option ) { $selectedData = ''; if( $option['key'] == $selected ) { $selectedData = ' selected="true"'; } $html .= '<option value="' . $option['key'] . '"' . $selectedData . '>' . $option['value'] . '</option>'; } $html .= '</select>'; return $html; } public function getPrivacyHTML( $name , $selected , $showSelf = false ) { $public = ( $selected == 0 ) ? 'btn-success' : 'btn-light'; $members = ( $selected == 20 ) ? 'btn-success' : 'btn-light'; $friends = ( $selected == 30 ) ? 'btn-success' : 'btn-light'; $self = ( $selected == 40 ) ? 'btn-success' : 'btn-light'; $html = '<div class="btn-group" data-toggle-name="' . $name . '" data-toggle="buttons-radio">'; $html .= '<button type="button" value="0" class="btn btn-small ' . $public . '" />' . Text::_('COM_COMMUNITY_PUBLIC').'</button>'; $html .= '<button type="button" value="20" class="btn btn-small ' . $members . '" /> ' . Text::_( 'COM_COMMUNITY_MEMBERS').'</button>'; $html .= '<button type="button" value="30" class="btn btn-small ' . $friends . '" /> ' . Text::_('COM_COMMUNITY_FRIENDS').'</button>'; if( $showSelf ) { $html .= '<button type="button" value="40" class="btn btn-small ' . $self . '" />' . Text::_('COM_COMMUNITY_SELF').'</button>'; } $html .= '</div>'; $html .= '<input type="hidden" name="' . $name . '" value="' . $selected . '" />'; return $html; } /** * Method to return the image path for specific elements * @access private * * @return string $image The path to the image. */ public function _getKarmaImage( $name ) { $image = ''; switch( $name ) { case 'point0': $image = Uri::root() . 'components/com_community/templates/default/images/karma-0.5-5.png'; break; case 'point1': $image = Uri::root() . 'components/com_community/templates/default/images/karma-1-5.png'; break; case 'point2': $image = Uri::root() . 'components/com_community/templates/default/images/karma-2-5.png'; break; case 'point3': $image = Uri::root() . 'components/com_community/templates/default/images/karma-3-5.png'; break; case 'point4': $image = Uri::root() . 'components/com_community/templates/default/images/karma-4-5.png'; break; case 'point5': $image = Uri::root() . 'components/com_community/templates/default/images/karma-5-5.png'; break; default: $image = Uri::root() . 'components/com_community/templates/default/images/karma-0-5.png'; break; } return $image; } public function setToolBar() { // Get the toolbar object instance $bar = Toolbar::getInstance('toolbar'); $jinput = Factory::getApplication()->input; // Set the titlebar text ToolbarHelper::title( Text::sprintf( 'COM_COMMUNITY_CONFIGURATION_PAGE_TITLE', Text::_('COM_COMMUNITY_CONFIG_TITLE_'.strtoupper(str_replace('-','_',$jinput->get( 'cfgSection' , 'site' )))) ), 'configuration'); // Add the necessary buttons ToolBarHelper::save( 'saveconfig', Text::_('COM_COMMUNITY_SAVE') ); ToolBarHelper::cancel(); } public function getEditors() { $db = Factory::getDBO(); // compile list of the editors $query = 'SELECT ' . $db->quoteName('element') . ' AS ' . $db->quoteName('value') . ', ' . $db->quoteName('name') . ' AS ' . $db->quoteName('text') . ' FROM ' . $db->quoteName(PLUGIN_TABLE_NAME) . ' WHERE ' . $db->quoteName('folder') . ' = ' . $db->Quote('editors') . ' AND ' . $db->quoteName(EXTENSION_ENABLE_COL_NAME) . ' = ' . $db->Quote(1) . ' ORDER BY ' . $db->quoteName('ordering') . ', ' . $db->quoteName('name'); $db->setQuery( $query ); $editors = $db->loadObjectList(); // Add JomSocial's Editor $editor = new stdClass(); $editor->value = 'jomsocial'; $editor->text = 'plg_editor_jomsocial'; array_push( $editors, $editor ); return $editors; } public function getFieldCodes( $elementName , $selected = '' ) { $db = Factory::getDBO(); $query = 'SELECT DISTINCT ' . $db->quoteName('fieldcode') . ' FROM ' . $db->quoteName('#__community_fields'); $db->setQuery( $query ); $fieldcodes = $db->loadObjectList(); $html = '<select name="'. $elementName . '">'; $html .='<option></option>'; foreach( $fieldcodes as $fieldcode ) { if( !empty($fieldcode->fieldcode ) ) { $selectedData = ''; if( $fieldcode->fieldcode == $selected ) { $selectedData = ' selected="true"'; } $html .= '<option value="' . $fieldcode->fieldcode . '"' . $selectedData . '>' . $fieldcode->fieldcode . '</option>'; } } $html .= '</select>'; return $html; } public function getFolderPermissionsPhoto( $name , $selected ) { $all = ( $selected == '0777' ) ? 'checked="true" ' : ''; $default = ( $selected == '0755' ) ? 'checked="true" ' : ''; $html = '<input type="radio" value="0777" name="' . $name . '" ' . $all . '/> ' . Text::_('COM_COMMUNITY_CHMOD777'); $html .= '<input type="radio" value="0755" name="' . $name . '" ' . $default . '/> ' . Text::_('COM_COMMUNITY_SYSTEM_DEFAULT'); return $html; } public function getFolderPermissionsVideo( $name , $selected ) { $all = ( $selected == '0777' ) ? 'checked="true" ' : ''; $default = ( $selected == '0755' ) ? 'checked="true" ' : ''; $html = '<input type="radio" value="0777" name="' . $name . '" ' . $all . '/> ' . Text::_('COM_COMMUNITY_CHMOD777'); $html .= '<input type="radio" value="0755" name="' . $name . '" ' . $default . '/> ' . Text::_('COM_COMMUNITY_SYSTEM_DEFAULT'); return $html; } public function getLocationFieldCodes($elementName, $selected = '') { $db = Factory::getDBO(); $query = 'SELECT DISTINCT ' . $db->quoteName('fieldcode') . ' FROM ' . $db->quoteName('#__community_fields') . ' ' . 'WHERE ' . $db->quoteName('type') . '=' . $db->Quote('location'); $db->setQuery($query); $fieldcodes = $db->loadObjectList(); $html = '<select name="'. $elementName . '">'; $html .= '<option value=""></option>'; foreach ($fieldcodes as $fieldcode) { if (!empty($fieldcode->fieldcode)) { $selectedData = ''; if ($fieldcode->fieldcode == $selected) { $selectedData = ' selected="true"'; } $html .= '<option value="' . $fieldcode->fieldcode . '"' . $selectedData . '>' . $fieldcode->fieldcode . '</option>'; } } $html .= '</select>'; return $html; } public function getLicenseDetail($license = null) { $return = array(); $domain = $_SERVER['HTTP_HOST']; $domain = str_replace("https://", "", $domain); $domain = str_replace("http://", "", $domain); $check_url = "https://www.jomsocial.com/index.php?option=com_digistore&controller=digistoreAutoinstaller&task=get_license_number_details&tmpl=component&format=raw&component=community&domain=".urlencode($domain)."&license=".trim($license); $license_details = file_get_contents($check_url); if($license_details === FALSE){ $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, $check_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $license_details = curl_exec ($curl); curl_close ($curl); } if(isset($license_details) && trim($license_details) != ""){ $license_details = json_decode($license_details, true); if(isset($license_details["0"])){ $license_details = $license_details["0"]; } if(isset($license_details["expires"]) && trim($license_details["expires"]) != "" && trim($license_details["expires"]) == "0000-00-00 00:00:00"){ $valid_license = true; } elseif(isset($license_details["expires"]) && trim($license_details["expires"]) != "" && trim($license_details["expires"]) != "0000-00-00 00:00:00"){ $now = strtotime(date("Y-m-d H:i:s")); $license_expires = strtotime(trim($license_details["expires"])); if($license_expires >= $now){ $valid_license = true; } } if(isset($license_details["domain"]) && isset($license_details["expires"])){ $domain = $license_details["domain"]; $date = $license_details["expires"]; $status = Text::_("COM_COMMUNITY_LICENSE_INACTIVE"); if($valid_license){ $status = Text::_("COM_COMMUNITY_LICENSE_ACTIVE"); } $return = array("domain"=>$domain, "date"=>$date, "status"=>$status); } } return $return; } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка