Пример #1
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // Get view related request variables.
     // Get model data.
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->item = $this->getModel()->getItem();
     $this->parentID = $this->state->get('parent.id');
     // If at the root, check storage useage and queue a message if near quota
     if (!$this->parentID) {
         $mparams = $app->getParams();
         $storQuota = (int) $mparams->get('storQuota', 0);
         if (!$storQuota) {
             $storQuota = (int) $this->state->cparams->get('storQuota', 0);
         }
         if ($storQuota) {
             $storSize = $this->get('StorSize');
             $posq = $storSize / $storQuota;
             if ($posq > 0.9) {
                 $svty = 'notice';
                 $msg = JText::sprintf('COM_USERNOTES_NOTICE_QUOTA', UserNotesHelper::formatBytes($storSize, 1, ''), $posq * 100);
                 if ($posq > 0.95) {
                     $svty = 'warning';
                     $msg = '<span style="color:red">' . $msg . '</span>';
                 }
                 $app->enqueueMessage($msg, $svty);
             }
         }
     }
     // Create breadcrumbs to this item
     $this->buildPathway($this->parentID);
     // Check for errors.
     // @TODO: Maybe this could go into JComponentHelper::raiseErrors($this->get('Errors'))
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     // Get the component parameters
     $this->cparams = JComponentHelper::getParams('com_usernotes');
     $this->_prepareDocument();
     return parent::display($tpl);
 }
Пример #2
0
 * @license    GNU General Public License version 3 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
JHtml::stylesheet('components/com_usernotes/static/css/oopim.css');
JHtml::_('jquery.framework', false);
$jdoc = JFactory::getDocument();
$jdoc->addScript('components/com_usernotes/static/js/oopim.js');
$jdoc->addScript('components/com_usernotes/static/js/notesview.js');
if ($this->item && $this->item->secured && $_SERVER['SERVER_PORT'] != 443) {
    //JError::raiseNotice(100, 'You do not have a secure connection!', 'error');
    JFactory::getApplication()->enqueueMessage('<span style="color:red">' . JText::_('COM_USERNOTES_NOTICE_INSECURE') . '</span>', 'warning');
    //echo '<div style="background-color:red;color:white;">WARNING: You do not have a secure connection!</div>';
}
if (isset($this->posq)) {
    $svty = 'notice';
    $msg = JText::sprintf('COM_USERNOTES_NOTICE_QUOTA', UserNotesHelper::formatBytes($this->storSize, 1, ''), $this->posq * 100);
    if ($this->posq > 0.95) {
        $svty = 'warning';
        $msg = '<span style="color:red">' . $msg . '</span>';
    }
    JFactory::getApplication()->enqueueMessage($msg, $svty);
}
//JFactory::getApplication()->enqueueMessage('<span style="color:red">'.JText::_('Storage usage is at 90% of quota!').'</span>', 'warning');
//JError::raiseNotice(100, 'Storage usage is at 90% of quota!');
//var_dump($this->params);echo'<br /><br />';var_dump(JComponentHelper::getParams('com_usernotes'));
if ($this->state->secured && $_SERVER['SERVER_PORT'] != 443) {
    $securl = $this->cparams->get('secureurl', '');
    if (!$securl) {
        $hostname = php_uname('n');
        $hostaddr = $_SERVER['SERVER_ADDR'];
        $paths = explode('/', __FILE__);
Пример #3
0
		<li><a href="#" onclick="toolAct(event,'unfrac')" title="Return HTML fractions to text">un-Fractionize</a></li>
<?php 
    if ($this->attached) {
        ?>
		<li><a href="#" onclick="toolAct(event,'delatts')" title="Delete all attachments" data-sure="delete all attachments"><?php 
        echo JText::_('Delete attachments');
        ?>
</a></li>
<?php 
    }
    ?>
	</ul>
</div>
<div id="filupld" class="uplddlog" style="display:none;">
	<span style="color:#36C;">Max file upload size: <?php 
    echo UserNotesHelper::formatBytes($this->maxUploadBytes);
    ?>
</span>
	<input type="file" id="upload_field" name="attm[]" multiple="multiple" />
	<div id="dropArea">Or drop files here</div>
	<div id="result"></div>
	<div id="totprogress"></div>
	<div id="fprogress"></div>
	<hr />
	<button onclick="this.parentNode.style.display='none'">Close</button>
</div>
<?php 
}
if ($this->attached) {
    ?>
<iframe id="dnldf" style="display:none;"></iframe>