示例#1
0
文件: item.php 项目: jewelhuq/okatea
        echo '<p>' . __('No detail') . '</p>';
    } else {
        echo '<ul>';
        foreach ($file->media_meta as $k => $v) {
            if ((string) $v) {
                echo '<li><strong>' . $k . ':</strong> ' . html::escapeHTML($v) . '</li>';
            }
        }
        echo '</ul>';
    }
}
if ($file->editable && $core_media_writable) {
    if ($file->media_type == 'image') {
        echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Update thumbnails') . '</legend>' . '<p>' . __('This will create or update thumbnails for this image.') . '</p>' . '<p><input type="submit" name="thumbs" value="' . __('update thumbnails') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    }
    if ($file->type == 'application/zip') {
        $inflate_combo = array(__('Extract in a new directory') => 'new', __('Extract in current directory') => 'current');
        echo '<form class="clear" id="file-unzip" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Extract archive') . '</legend>' . '<ul>' . '<li><strong>' . __('Extract in a new directory') . '</strong> : ' . __('This will extract archive in a new directory that should not exists yet.') . '</li>' . '<li><strong>' . __('Extract in current directory') . '</strong> : ' . __('This will extract archive in current directory and will overwrite existing files or directory.') . '</li>' . '</ul>' . '<p><label class="classic">' . __('Extract mode:') . ' ' . form::select('inflate_mode', $inflate_combo, 'new') . '</label> ' . '<input type="submit" name="unzip" value="' . __('c_c_action_extract') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    }
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Change media properties') . '</legend>' . '<p class="field"><label>' . __('File name:') . '</label>' . form::text('media_file', 30, 255, html::escapeHTML($file->basename)) . '</p>' . '<p class="field"><label>' . __('File title:') . '</label>' . form::text('media_title', 30, 255, html::escapeHTML($file->media_title)) . '</p>' . '<p class="field"><label>' . __('File date:') . '</label>' . form::text('media_dt', 16, 16, html::escapeHTML($file->media_dtstr)) . '</p>' . '<p class="field"><label class="classic">' . form::checkbox('media_private', 1, $file->media_priv) . ' ' . __('Private') . '</label></p>' . '<p class="field"><label>' . __('New directory:') . '</label>' . form::select('media_path', $dirs_combo, dirname($file->relname)) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_save') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<fieldset><legend>' . __('Change file') . '</legend>' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), OKT_MAX_UPLOAD_SIZE) . '</div>' . '<p class="field"><label for="upfile">' . __('Choose a file:') . '</label>' . '<input type="file" id="upfile" name="upfile" size="35" /></p>' . '<p class="note">' . sprintf(__('c_c_maximum_file_size_%s'), util::l10nFileSize(OKT_MAX_UPLOAD_SIZE)) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_send') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
}
echo '</div>';
echo '</div>';
echo '</div>';
# Pied-de-page
if ($popup) {
    require OKT_ADMIN_FOOTER_SIMPLE_FILE;
} else {
    require OKT_ADMIN_FOOTER_FILE;
}
    public static function displayPublicAdminBar($okt)
    {
        $aBasesUrl = new ArrayObject();
        $aPrimaryAdminBar = new ArrayObject();
        $aSecondaryAdminBar = new ArrayObject();
        $aBasesUrl['admin'] = $okt->config->app_path . OKT_ADMIN_DIR;
        $aBasesUrl['logout'] = $aBasesUrl['admin'] . '/index.php?logout=1';
        $aBasesUrl['profil'] = $aBasesUrl['admin'];
        # -- CORE TRIGGER : publicAdminBarBeforeDefaultsItems
        $okt->triggers->callTrigger('publicAdminBarBeforeDefaultsItems', $okt, $aPrimaryAdminBar, $aSecondaryAdminBar, $aBasesUrl);
        # éléments première barre
        $aPrimaryAdminBar[10] = array('intitle' => '<img src="' . OKT_PUBLIC_URL . '/img/notify/error.png" width="22" height="22" alt="' . __('c_c_warning') . '" />', 'items' => array());
        $aPrimaryAdminBar[100] = array('href' => $aBasesUrl['admin'], 'intitle' => __('c_c_administration'));
        $aPrimaryAdminBar[200] = array('intitle' => __('c_c_action_Add'), 'items' => array());
        # éléments seconde barre
        $aSecondaryAdminBar[100] = array('href' => $aBasesUrl['profil'], 'intitle' => sprintf(__('c_c_user_hello_%s'), html::escapeHTML(oktAuth::getUserCN($okt->user->username, $okt->user->lastname, $okt->user->firstname))));
        if (!$okt->languages->unique) {
            $iStartIdx = 150;
            foreach ($okt->languages->list as $aLanguage) {
                if ($aLanguage['code'] == $okt->user->language) {
                    continue;
                }
                $aSecondaryAdminBar[$iStartIdx++] = array('href' => html::escapeHTML($okt->config->app_path . $aLanguage['code'] . '/'), 'title' => html::escapeHTML($aLanguage['title']), 'intitle' => '<img src="' . OKT_PUBLIC_URL . '/img/flags/' . $aLanguage['img'] . '" alt="' . html::escapeHTML($aLanguage['title']) . '" />');
            }
        }
        $aSecondaryAdminBar[200] = array('href' => $aBasesUrl['logout'], 'intitle' => __('c_c_user_log_off_action'));
        # infos super-admin
        if ($okt->checkPerm('is_superadmin')) {
            # avertissement nouvelle version disponible
            if ($okt->config->update_enabled && is_readable(OKT_DIGESTS)) {
                $updater = new oktUpdate($okt->config->update_url, 'okatea', $okt->config->update_type, OKT_CACHE_PATH . '/versions');
                $new_v = $updater->check(util::getVersion());
                if ($updater->getNotify() && $new_v) {
                    # locales
                    l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.update');
                    $aPrimaryAdminBar[10]['items'][100] = array('href' => $aBasesUrl['admin'] . '/configuration.php?action=update', 'intitle' => sprintf(__('c_a_update_okatea_%s_available'), $new_v));
                }
            }
            # avertissement mode maintenance est activé sur la partie publique
            if ($okt->config->public_maintenance_mode) {
                $aPrimaryAdminBar[10]['items'][300] = array('href' => $aBasesUrl['admin'] . '/configuration.php?action=advanced#tab_others', 'intitle' => sprintf(__('c_a_public_maintenance_mode_enabled'), $new_v));
            }
            # avertissement mode maintenance est activé sur l'admin
            if ($okt->config->admin_maintenance_mode) {
                $aPrimaryAdminBar[10]['items'][400] = array('href' => $aBasesUrl['admin'] . '/configuration.php?action=advanced#tab_others', 'intitle' => sprintf(__('c_a_admin_maintenance_mode_enabled'), $new_v));
            }
            # info execution
            $aExecInfos = array();
            $aExecInfos['execTime'] = util::getExecutionTime();
            if (OKT_XDEBUG) {
                $aExecInfos['memUsage'] = util::l10nFileSize(xdebug_memory_usage());
                $aExecInfos['peakUsage'] = util::l10nFileSize(xdebug_peak_memory_usage());
            } else {
                $aExecInfos['memUsage'] = util::l10nFileSize(memory_get_usage());
                $aExecInfos['peakUsage'] = util::l10nFileSize(memory_get_peak_usage());
            }
            $aSecondaryAdminBar[1000] = array('title' => $aExecInfos['execTime'] . ' s - ' . $aExecInfos['memUsage'], 'intitle' => '<img src="' . OKT_PUBLIC_URL . '/img/ico/terminal.gif" width="16" height="16" alt="" />', 'items' => array(array('intitle' => 'Temps d\'execution du script&nbsp;: ' . $aExecInfos['execTime'] . ' s'), array('intitle' => 'Mémoire utilisée par PHP&nbsp;: ' . $aExecInfos['memUsage']), array('intitle' => 'Pic mémoire allouée par PHP&nbsp;: ' . $aExecInfos['peakUsage']), array('intitle' => 'Router lang&nbsp;: ' . $okt->router->getLanguage()), array('intitle' => 'Router path&nbsp;: ' . $okt->router->getPath()), array('intitle' => 'Router route ID&nbsp;: ' . $okt->router->getFindedRouteId())));
            if (!empty($okt->page->module)) {
                $aSecondaryAdminBar[1000]['items'][] = array('intitle' => '$okt->page->module&nbsp;: ' . $okt->page->module);
            }
            if (!empty($okt->page->action)) {
                $aSecondaryAdminBar[1000]['items'][] = array('intitle' => '$okt->page->action&nbsp;: ' . $okt->page->action);
            }
        }
        # -- CORE TRIGGER : publicAdminBarItems
        $okt->triggers->callTrigger('publicAdminBarItems', $okt, $aPrimaryAdminBar, $aSecondaryAdminBar, $aBasesUrl);
        # sort items of by keys
        $aPrimaryAdminBar->ksort();
        $aSecondaryAdminBar->ksort();
        # remove empty values of admins bars
        $aPrimaryAdminBar = array_filter((array) $aPrimaryAdminBar);
        $aSecondaryAdminBar = array_filter((array) $aSecondaryAdminBar);
        # reverse sedond bar items
        $aSecondaryAdminBar = array_reverse($aSecondaryAdminBar);
        $class = '';
        ?>
		<div id="oktadminbar" class="<?php 
        echo $class;
        ?>
" role="navigation">
			<a class="screen-reader-shortcut" href="#okt-toolbar" tabindex="1"><?php 
        _e('Skip to toolbar');
        ?>
			</a>
			<div class="quicklinks" id="okt-toolbar" role="navigation"
				aria-label="<?php 
        echo util::escapeAttrHTML(__('Top navigation toolbar.'));
        ?>
"
				tabindex="0">
				<ul class="ab-top-menu">
					<?php 
        foreach ($aPrimaryAdminBar as $aPrimaryItem) {
            echo self::getItems($aPrimaryItem);
        }
        ?>
				</ul>
				<ul class="ab-top-secondary ab-top-menu">
					<?php 
        foreach ($aSecondaryAdminBar as $aSecondaryItem) {
            echo self::getItems($aSecondaryItem);
        }
        ?>
				</ul>
			</div>
			<a class="screen-reader-shortcut"
				href="<?php 
        echo $aBasesUrl['logout'];
        ?>
"><?php 
        _e('c_c_user_log_off_action');
        ?>
			</a>
		</div>
		<?php 
    }
示例#3
0
</a>
				</li>
			</ul>
		</td>
	</tr>
	<?php 
        $count_line++;
    }
    ?>
	</tbody>
	<tfoot>
	<tr>
		<td colspan="4">&nbsp;</td>
		<td><?php 
    echo $num_rows;
    ?>
</td>
		<td><?php 
    echo util::l10nFileSize($db_size);
    ?>
</td>
		<td><?php 
    echo util::l10nFileSize($db_pertes);
    ?>
</td>
		<td>&nbsp;</td>
	</tr>
	</tfoot>
</table>
<?php 
}
示例#4
0
文件: item.php 项目: jewelhuq/okatea
        ?>
 <span class="lang-switcher-buttons"></span></label>
	<?php 
        echo form::text(array('p_images_alt_1[' . $aLanguage['code'] . ']', 'p_images_alt_1_' . $aLanguage['code']), 40, 255, '');
        ?>
</p>
	<?php 
    }
    ?>

<?php 
}
?>

<p class="note"><?php 
printf(__('c_c_maximum_file_size_%s'), util::l10nFileSize(OKT_MAX_UPLOAD_SIZE));
?>
</p>

<?php 
$aItemData['tabs'][20]['content'] = ob_get_clean();
# onglet options
$aItemData['tabs'][30] = array('id' => 'tab-options', 'title' => __('m_galleries_item_tab_options'), 'content' => '');
ob_start();
?>

	<h3><?php 
_e('m_galleries_item_tab_title_options');
?>
</h3>
示例#5
0
			<p class="col"><a href="<?php 
        echo $file['url'];
        ?>
"><img src="<?php 
        echo OKT_PUBLIC_URL . '/img/media/' . $file['type'] . '.png';
        ?>
" alt="" /></a>
			<?php 
        echo !empty($file['title'][$okt->user->language]) ? html::escapeHTML($file['title'][$okt->user->language]) : '';
        ?>
 (<?php 
        echo $file['mime'];
        ?>
)
			- <?php 
        echo util::l10nFileSize($file['size']);
        ?>
</p>

			<?php 
    }
    # fin Okatea : boucle sur les fichiers
    ?>

		</div><!-- #post-files -->
		<?php 
}
# fin Okatea : si les fichiers sont activées
?>

	</div><!-- #post-footer -->
示例#6
0
" alt="<?php 
                echo $files_infos[$aLanguage['code']][$i]['type'];
                ?>
" />
				<?php 
                echo $files_infos[$aLanguage['code']][$i]['filename'];
                ?>
				- <?php 
                echo $files_infos[$aLanguage['code']][$i]['type'];
                ?>
 (<?php 
                echo $files_infos[$aLanguage['code']][$i]['mime'];
                ?>
)
				- <?php 
                echo util::l10nFileSize($files_infos[$aLanguage['code']][$i]['size']);
                ?>
				- <a href="module.php?m=faq&amp;action=edit&amp;questions_id=<?php 
                echo $questions_id;
                ?>
&amp;delfile=<?php 
                echo $files_infos[$aLanguage['code']][$i]['filename'];
                ?>
"><?php 
                _e('c_c_action_delete');
                ?>
</a>
				</p>
				<?php 
            }
            ?>
示例#7
0
 public function getPublicLine($k, $v, $c)
 {
     if ($k == '.') {
         return;
     }
     $td_class = $c == 1 ? 'odd' : 'even';
     $res = '<tr>';
     $res .= $this->getIconCell($v, $td_class);
     $res .= '<td class="' . $td_class . '">';
     if ($v['jail'] && $v['r'] && ($v['f'] || $v['d'] && $v['x'])) {
         $res .= '<a href="' . $this->getLink($this->get . '=' . $v['l'] . '&amp;dl=1') . '">' . $k . '</a>';
     } else {
         $res .= $k;
     }
     $res .= '</td>';
     $filesize = filesize($v['fname']);
     $res .= '<td class="' . $td_class . ' small nowrap">' . ($filesize > 0 ? util::l10nFileSize($filesize) : '-') . '</td>';
     $res .= '<td class="' . $td_class . ' small nowrap">' . strftime('%d-%m-%Y %H:%M:%S', $v['mtime']) . '</td>';
     $res .= '<td class="' . $td_class . ' small">';
     if ($v['jail'] && $v['r'] && $v['f']) {
         $res .= '<a href="' . $this->getLink($this->get . '=' . $v['l'] . '&amp;dl=1') . '">' . '<img src="' . $this->p_img . 'download.png" alt="télécharger" /></a> ';
     }
     $res .= '</td>';
     $res .= '</tr>';
     return $res;
 }
示例#8
0
"><img src="<?php 
            echo OKT_PUBLIC_URL . '/img/media/' . $post_files[$i]['type'] . '.png';
            ?>
" alt="<?php 
            echo html::escapeHTML($post_files[$i]['title']);
            ?>
" /></a>
					<?php 
            echo $post_files[$i]['type'];
            ?>
 (<?php 
            echo $post_files[$i]['mime'];
            ?>
)
					- <?php 
            echo util::l10nFileSize($post_files[$i]['size']);
            ?>
</p>

					<?php 
            if ($can_edit_product) {
                ?>
						<p><a href="module.php?m=catalog&amp;action=edit&amp;product_id=<?php 
                echo $product_id;
                ?>
&amp;delete_file=<?php 
                echo $i;
                ?>
"
						onclick="return window.confirm('<?php 
                echo html::escapeJS('Etes-vous sûr de vouloir supprimer ce fichier ? Cette action est irréversible.');
示例#9
0
 /**
  * Détermine les données de la debug bar.
  *
  * @return void
  */
 public function setData()
 {
     $this->aDebugBarData = array();
     $this->aDebugBarData['num_data'] = array();
     if ($this->aConfig['tabs']['super_globales']) {
         $this->aDebugBarData['num_data']['get'] = count($_GET);
         $this->aDebugBarData['num_data']['post'] = count($_POST);
         $this->aDebugBarData['num_data']['cookie'] = count($_COOKIE);
         $this->aDebugBarData['num_data']['files'] = count($_FILES);
         $this->aDebugBarData['num_data']['session'] = count($_SESSION);
         $this->aDebugBarData['num_data']['server'] = count($_SERVER);
         $this->aDebugBarData['num_data']['env'] = count($_ENV);
         $this->aDebugBarData['num_data']['request'] = count($_REQUEST);
     }
     if ($this->aConfig['tabs']['app']) {
         $this->aDebugBarData['definedVars'] = self::getDefinedVars();
         $this->aDebugBarData['definedConstants'] = self::getDefinedConstants();
         $this->aDebugBarData['configVars'] = $this->okt->config->get();
         $this->aDebugBarData['userVars'] = $this->okt->user->getData(0);
         $this->aDebugBarData['l10nVars'] = !empty($__l10n) ? $__l10n : array();
         $this->aDebugBarData['num_data']['definedVars'] = count($this->aDebugBarData['definedVars']);
         $this->aDebugBarData['num_data']['definedConstants'] = count($this->aDebugBarData['definedConstants']);
         $this->aDebugBarData['num_data']['configVars'] = count($this->aDebugBarData['configVars']);
         $this->aDebugBarData['num_data']['userVars'] = count($this->aDebugBarData['userVars']);
         $this->aDebugBarData['num_data']['l10nVars'] = count($this->aDebugBarData['l10nVars']);
     }
     if ($this->aConfig['tabs']['logs']) {
         $this->aDebugBarData['num_data']['logs'] = $this->okt->debug->getNum();
     }
     if ($this->aConfig['tabs']['db']) {
         $this->aDebugBarData['num_data']['queries'] = $this->okt->db->nbQueries();
     }
     if ($this->aConfig['tabs']['tools']) {
         $this->aDebugBarData['execTime'] = util::getExecutionTime();
         if (OKT_XDEBUG) {
             $this->aDebugBarData['memUsage'] = util::l10nFileSize(xdebug_memory_usage());
             $this->aDebugBarData['peakUsage'] = util::l10nFileSize(xdebug_peak_memory_usage());
         } else {
             $this->aDebugBarData['memUsage'] = util::l10nFileSize(memory_get_usage());
             $this->aDebugBarData['peakUsage'] = util::l10nFileSize(memory_get_peak_usage());
         }
     }
 }
示例#10
0
文件: index.php 项目: jewelhuq/okatea
function mediaItemLine($f, $i)
{
    global $okt, $page_url, $popup;
    $fname = $f->basename;
    if ($f->d) {
        $link = html::escapeURL($page_url) . '&amp;d=' . html::sanitizeURL($f->relname);
        if ($f->parent) {
            $fname = '..';
        }
    } else {
        $link = 'module.php?m=media_manager&action=item&id=' . $f->media_id . '&amp;popup=' . $popup;
    }
    $class = 'media-item media-col-' . $i % 2;
    $res = '<div class="' . $class . '"><a class="media-icon media-link" href="' . $link . '">' . '<img src="' . $f->media_icon . '" alt="" /></a>' . '<ul>' . '<li><a class="media-link" href="' . $link . '">' . $fname . '</a></li>';
    if (!$f->d) {
        $res .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . util::l10nFileSize($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('c_c_action_open') . '</a>' . '</li>';
    }
    $res .= '<li class="media-action">&nbsp;';
    if ($popup && !$f->d) {
        $res .= '<a href="' . $link . '"><img src="' . OKT_PUBLIC_URL . '/img/ico/plus.png" alt="' . __('Insert this file') . '" ' . 'title="' . __('Insert this file') . '" /></a> ';
    }
    if ($f->del) {
        $res .= '<a href="' . html::escapeURL($page_url) . '&amp;d=' . rawurlencode($GLOBALS['d']) . '&amp;remove=' . rawurlencode($f->basename) . '" class="icon delete">' . __('c_c_action_delete') . '</a>';
    }
    $res .= '</li>';
    if ($f->type == 'audio/mpeg3') {
        $res .= '<li>' . oktMedia::mp3player($f->file_url, 'index.php?pf=player_mp3.swf') . '</li>';
    }
    $res .= '</ul></div>';
    return $res;
}