本文整理汇总了PHP中Sobi::Ico方法的典型用法代码示例。如果您正苦于以下问题:PHP Sobi::Ico方法的具体用法?PHP Sobi::Ico怎么用?PHP Sobi::Ico使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sobi
的用法示例。
在下文中一共展示了Sobi::Ico方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _fileUpload
/**
* Creates ajax file field
*
* @param string $name - name of the html field
* @param string $accept - accepted file types
* @param string $value - possible value for the inbox
* @param string $class - class name
* @param string $task - task override
* @param array $scripts - custom JavaScript files
* @param array $request - custom request
* @return string
*/
public static function _fileUpload($name, $accept = '*', $value = null, $class = 'spFileUpload', $task = 'file.upload', $scripts = array('jquery', 'jquery-form', 'fileupload'), $request = null)
{
if (is_string($scripts)) {
$scripts = SPFactory::config()->structuralData($scripts);
}
SPFactory::header()->addJsFile($scripts);
if (!$request) {
$request = array('option' => 'com_sobipro', 'task' => $task, 'sid' => Sobi::Section(), 'ident' => $name . '-file', SPFactory::mainframe()->token() => 1, 'format' => 'raw');
}
$classes = array('class' => 'hide spFileUploadHidden');
SPLoader::loadClass('env.browser');
$browser = SPBrowser::getInstance()->get('browser');
$stupidInternetExplorer = false;
if (strstr(strtolower($browser), 'internet explorer')) {
$classes = array('class' => '');
$stupidInternetExplorer = true;
}
if (Sobi::Cfg('template.bootstrap3-styles')) {
$column = "col-sm-";
} else {
$column = "span";
}
$f = null;
$f .= "<div class=\"{$class}\" data-section=" . Sobi::Section() . ">";
$f .= '<div class="file">';
$f .= self::file($name . '-file', 0, $classes, $accept);
$f .= '</div>';
$b3class = '';
if (Sobi::Cfg('template.bootstrap3-styles')) {
$b3class = ' form-control';
}
if (!$stupidInternetExplorer) {
$f .= "<input type=\"text\" readonly=\"readonly\" class=\"input-large selected pull-left{$b3class}\" value=\"{$value}\"/>";
}
$f .= '<div class="btn-group">';
if (!$stupidInternetExplorer) {
$f .= '<button class="btn btn-default select" type="button"><i class="' . Sobi::Ico('upload-field.search-button') . '"></i> ' . Sobi::Txt('UPLOAD_SELECT') . '</button>';
}
$f .= '<button class="btn btn-default upload hide" disabled="disabled" type="button" rel=\'' . json_encode($request) . '\'>' . Sobi::Txt('START_UPLOAD') . ' <i class="icon-upload-alt"></i></button>';
$f .= '<button class="btn btn-default remove" disabled="disabled" type="button">' . ' <i class="' . Sobi::Ico('upload-field.remove-button') . '"></i></button>';
$f .= '</div>';
$f .= '<div class="hide progress-container row">';
$f .= '<div class="' . $column . '1">';
$f .= '<span class="progress-message badge badge-success">0%</span>';
$f .= '</div>';
$f .= '<div class="progress progress-success ' . $column . '6"><div class="bar"></div></div>';
$f .= '</div>';
$f .= '<div class="alert hide"><button type="button" class="close" data-dismiss="alert">×</button><div> </div></div>';
$f .= "<input type=\"hidden\" name=\"{$name}\" value=\"\" class='idStore'/>";
$f .= '</div>';
return $f;
}