本文整理匯總了PHP中FabrikHelperHTML::canvasSupport方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::canvasSupport方法的具體用法?PHP FabrikHelperHTML::canvasSupport怎麽用?PHP FabrikHelperHTML::canvasSupport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::canvasSupport方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: plupload
/**
* Create the html for Ajax upload widget
*
* @param array $str Current html output
* @param int $repeatCounter Repeat group counter
* @param array $values Existing files
*
* @return array Modified fileupload html
*/
protected function plupload($str, $repeatCounter, $values)
{
FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css');
$id = $this->getHTMLId($repeatCounter);
$j3 = FabrikWorker::j3();
$params = $this->getParams();
$winWidth = $params->get('win_width', 400);
$winHeight = $params->get('win_height', 400);
$runtimes = $params->get('ajax_runtime', 'html5,html4');
$w = (int) $params->get('ajax_dropbox_width', 0);
$h = (int) $params->get('ajax_dropbox_hight', 200);
$dropBoxStyle = 'height:' . $h . 'px';
if ($w !== 0) {
$dropBoxStyle .= 'width:' . $w . 'px;';
}
// Add span with id so that element fxs work.
$pstr = array();
$pstr[] = '<span id="' . $id . '"></span>';
$pstr[] = '<div id="' . $id . '-widgetcontainer">';
$pstr[] = '<canvas id="' . $id . '-widget" width="' . $winWidth . '" height="' . $winHeight . '"></canvas>';
if ($this->canCrop()) {
$pstr[] = '<div class="zoom" style="float:left;margin-top:10px;padding-right:10x;width:180px">';
$pstr[] = ' zoom:';
$pstr[] = ' <div class="fabrikslider-line" style="width: 100px;float:left;">';
$pstr[] = ' <div class="knob"></div>';
$pstr[] = ' </div>';
$pstr[] = ' <input name="zoom-val" value="" size="3" class="input-mini"/>';
$pstr[] = '</div>';
$pstr[] = '<div class="rotate" style="float:left;margin-top:10px;width:180px">' . JText::_('PLG_ELEMENT_FILEUPLOAD_ROTATE') . ':';
$pstr[] = ' <div class="fabrikslider-line" style="width: 100px;float:left;">';
$pstr[] = ' <div class="knob"></div>';
$pstr[] = ' </div>';
$pstr[] = ' <input name="rotate-val" value="" size="3" class="input-mini"/>';
$pstr[] = '</div>';
}
if (FabrikHelperHTML::canvasSupport()) {
$pstr[] = '<div style="text-align: right;float:right;margin:10px 0; width: 205px">';
$pstr[] = '<input type="button" class="button btn btn-primary" name="close-crop" value="' . JText::_('CLOSE') . '" />';
$pstr[] = '</div>';
}
$pstr[] = '</div>';
$pstr[] = '<div class="plupload_container fabrikHide" id="' . $id . '_container" style="' . $dropBoxStyle . '">';
$pstr[] = '<div class="plupload" id="' . $id . '_dropList_container">';
if ($j3) {
$pstr[] = ' <table class="table table-striped table-condensed">';
$pstr[] = ' <thead style="display:none"><tr>';
$pstr[] = ' <th class="span4">' . JText::_('PLG_ELEMENT_FILEUPLOAD_FILENAME') . '</th>';
$pstr[] = ' <th class="span1 plupload_crop"> </th>';
$pstr[] = ' <th class="span5 plupload_file_status"></th>';
$pstr[] = ' <th class="span1 plupload_file_action"> </th>';
$pstr[] = ' </tr></thead>';
$pstr[] = ' <tbody class="plupload_filelist" id="' . $id . '_dropList">';
$pstr[] = ' </tbody>';
$pstr[] = ' <tfoot><tr><td colspan="4">';
$pstr[] = ' <a id="' . $id . '_browseButton" class="btn btn-mini" href="#"><i class="icon-plus-sign icon-plus"></i>' . JText::_('PLG_ELEMENT_FILEUPLOAD_ADD_FILES') . '</a>';
$pstr[] = ' <a class="btn btn-mini disabled" data-action="plupload_start" href="#"><i class="icon-upload"></i>' . JText::_('PLG_ELEMENT_FILEUPLOAD_START_UPLOAD') . '</a>';
$pstr[] = ' <span class="plupload_upload_status"></span>';
$pstr[] = '</td></tr></tfoot>';
$pstr[] = ' </table>';
} else {
$pstr[] = ' <div class="plupload_header">';
$pstr[] = ' <div class="plupload_header_content">';
$pstr[] = ' <div class="plupload_header_title">' . JText::_('PLG_ELEMENT_FILEUPLOAD_PLUP_HEADING') . '</div>';
$pstr[] = ' <div class="plupload_header_text">' . JText::_('PLG_ELEMENT_FILEUPLOAD_PLUP_SUB_HEADING') . '</div>';
$pstr[] = ' </div>';
$pstr[] = ' </div>';
$pstr[] = ' <div class="plupload_content">';
$pstr[] = ' <div class="plupload_filelist_header">';
$pstr[] = ' <div class="plupload_file_name">' . JText::_('PLG_ELEMENT_FILEUPLOAD_FILENAME') . '</div>';
$pstr[] = ' <div class="plupload_file_action"> </div>';
$pstr[] = ' <div class="plupload_file_status"><span>' . JText::_('PLG_ELEMENT_FILEUPLOAD_STATUS') . '</span></div>';
$pstr[] = ' <div class="plupload_file_size">' . JText::_('PLG_ELEMENT_FILEUPLOAD_SIZE') . '</div>';
$pstr[] = ' <div class="plupload_clearer"> </div>';
$pstr[] = ' </div>';
$pstr[] = ' <ul class="plupload_filelist" id="' . $id . '_dropList">';
$pstr[] = ' </ul>';
$pstr[] = ' <div class="plupload_filelist_footer">';
$pstr[] = ' <div class="plupload_file_name">';
$pstr[] = ' <div class="plupload_buttons">';
$pstr[] = ' <a id="' . $id . '_browseButton" class="plupload_button plupload_add" href="#">' . JText::_('PLG_ELEMENT_FILEUPLOAD_ADD_FILES') . '</a>';
$pstr[] = ' <a class="plupload_button plupload_start plupload_disabled" href="#">' . JText::_('PLG_ELEMENT_FILEUPLOAD_START_UPLOAD') . '</a>';
$pstr[] = ' </div>';
$pstr[] = ' <span class="plupload_upload_status"></span>';
$pstr[] = ' </div>';
$pstr[] = ' <div class="plupload_file_action"></div>';
$pstr[] = ' <div class="plupload_file_status">';
$pstr[] = ' <span class="plupload_total_status"></span>';
$pstr[] = ' </div>';
$pstr[] = ' <div class="plupload_file_size">';
$pstr[] = ' <span class="plupload_total_file_size"></span>';
$pstr[] = ' </div>';
//.........這裏部分代碼省略.........
示例2: plupload
/**
* Create the html for Ajax upload widget
*
* @param array $str Current html output
* @param int $repeatCounter Repeat group counter
* @param array $values Existing files
*
* @return array Modified file-upload html
*/
protected function plupload($str, $repeatCounter, $values)
{
FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css');
$params = $this->getParams();
$w = (int) $params->get('ajax_dropbox_width', 0);
$h = (int) $params->get('ajax_dropbox_height', 200);
$dropBoxStyle = 'height:' . $h . 'px;';
if ($w !== 0) {
$dropBoxStyle .= 'width:' . $w . 'px;';
}
$layout = $this->getLayout('widget');
$displayData = new stdClass();
$displayData->id = $this->getHTMLId($repeatCounter);
$displayData->winWidth = $params->get('win_width', 400);
$displayData->winHeight = $params->get('win_height', 400);
$displayData->canCrop = $this->canCrop();
$displayData->canvasSupport = FabrikHelperHTML::canvasSupport();
$displayData->dropBoxStyle = $dropBoxStyle;
$displayData->field = implode("\n", $str);
$displayData->j3 = FabrikWorker::j3();
$str = (array) $layout->render($displayData);
FabrikHelperHTML::jLayoutJs('fabrik-progress-bar', 'fabrik-progress-bar', (object) array('context' => '', 'animated' => true));
FabrikHelperHTML::jLayoutJs('fabrik-progress-bar-success', 'fabrik-progress-bar', (object) array('context' => 'success', 'value' => 100));
FabrikHelperHTML::jLayoutJs('fabrik-icon-delete', 'fabrik-icon', (object) array('icon' => 'delete'), array('debug' => true));
return $str;
}
示例3: pluploadModal
/**
* Create the upload modal and its content
* Needs to be a unique $modalId to ensure that multiple modals can be created
* each with unique content
*
* @param int $repeatCounter
*/
protected function pluploadModal($repeatCounter)
{
$params = $this->getParams();
$modalContentLayout = $this->getLayout('modal-content');
$modalData = (object) array('id' => $this->getHTMLId($repeatCounter), 'canCrop' => $this->canCrop(), 'canvasSupport' => FabrikHelperHTML::canvasSupport(), 'width' => $params->get('win_width', 400), 'height' => $params->get('win_height', 400));
$modalContent = $modalContentLayout->render($modalData);
$modalTitle = $this->canCrop() ? 'PLG_ELEMENT_FILEUPLOAD_CROP_AND_SCALE' : 'PLG_ELEMENT_FILEUPLOAD_PREVIEW';
$modalId = $this->modalId($repeatCounter);
$modalOpts = array('content' => $modalContent, 'id' => $modalId, 'title' => JText::_($modalTitle), 'modal' => true);
FabrikHelperHTML::jLayoutJs($modalId, 'fabrik-modal', (object) $modalOpts);
}