当前位置: 首页>>代码示例>>PHP>>正文


PHP WebPage::add方法代码示例

本文整理汇总了PHP中WebPage::add方法的典型用法代码示例。如果您正苦于以下问题:PHP WebPage::add方法的具体用法?PHP WebPage::add怎么用?PHP WebPage::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebPage的用法示例。


在下文中一共展示了WebPage::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DisplayWelcomePopup

/**
 * Displays a popup welcome message, once per session at maximum
 * until the user unchecks the "Display welcome at startup"
 * @param WebPage $oP The current web page for the display
 * @return void
 */
function DisplayWelcomePopup(WebPage $oP)
{
    if (!isset($_SESSION['welcome'])) {
        // Check, only once per session, if the popup should be displayed...
        // If the user did not already ask for hiding it forever
        $bPopup = appUserPreferences::GetPref('welcome_popup', true);
        if ($bPopup) {
            $sTemplate = @file_get_contents('../application/templates/welcome_popup.html');
            if ($sTemplate !== false) {
                $oTemplate = new DisplayTemplate($sTemplate);
                $oP->add("<div id=\"welcome_popup\">");
                $oTemplate->Render($oP, array());
                $oP->add("<p style=\"float:left\"><input type=\"checkbox\" checked id=\"display_welcome_popup\"/><label for=\"display_welcome_popup\">&nbsp;" . Dict::S('UI:DisplayThisMessageAtStartup') . "</label></p>\n");
                $oP->add("<p style=\"float:right\"><input type=\"button\" value=\"" . Dict::S('UI:Button:Ok') . "\" onClick=\"\$('#welcome_popup').dialog('close');\"/>\n");
                $oP->add("</div>\n");
                $sTitle = addslashes(Dict::S('UI:WelcomeMenu:Title'));
                $oP->add_ready_script(<<<EOF
\t\$('#welcome_popup').dialog( { width:'80%', height: 'auto', title: '{$sTitle}', autoOpen: true, modal:true,
\t\t\t\t\t\t\t\t  close: function() {
\t\t\t\t\t\t\t\t  \tvar bDisplay = \$('#display_welcome_popup:checked').length;
\t\t\t\t\t\t\t\t  \tSetUserPreference('welcome_popup', bDisplay, true); 
\t\t\t\t\t\t\t\t  }
\t\t\t\t\t\t\t\t  });
\tif (\$('#welcome_popup').height() > (\$(window).height()-70))
\t{
\t\t\$('#welcome_popup').height(\$(window).height()-70);
\t}
EOF
);
                $_SESSION['welcome'] = 'ok';
            }
        }
    }
}
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:40,代码来源:UI.php

示例2: DisplayFormPart

 public function DisplayFormPart(WebPage $oP, $sPartId)
 {
     switch ($sPartId) {
         case 'xml_options':
             $sNoLocalizeChecked = utils::ReadParam('no_localize', 0) == 1 ? ' checked ' : '';
             $sLinksetChecked = utils::ReadParam('linksets', 0) == 1 ? ' checked ' : '';
             $oP->add('<fieldset><legend>' . Dict::S('Core:BulkExport:XMLOptions') . '</legend>');
             $oP->add('<table>');
             $oP->add('<tr>');
             $oP->add('<td><input type="checkbox" id="xml_no_localize" name="no_localize" value="1"' . $sNoLocalizeChecked . '><label for="xml_no_localize"> ' . Dict::S('Core:BulkExport:OptionNoLocalize') . '</label></td>');
             $oP->add('</tr>');
             $oP->add('<tr>');
             $oP->add('<td><input type="checkbox" id="xml_linksets" name="linksets" value="1"' . $sLinksetChecked . '><label for="xml_linksets"> ' . Dict::S('Core:BulkExport:OptionLinkSets') . '</label></td>');
             $oP->add('</tr>');
             $oP->add('</table>');
             $oP->add('</fieldset>');
             break;
         default:
             return parent::DisplayFormPart($oP, $sPartId);
     }
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:21,代码来源:xmlbulkexport.class.inc.php

示例3: add

 public function add($sText)
 {
     if (!$this->m_bPassThrough) {
         parent::add($sText);
     } else {
         if ($this->m_bHeaderSent) {
             echo $sText;
         } else {
             $s_captured_output = $this->ob_get_clean_safe();
             foreach ($this->a_headers as $s_header) {
                 header($s_header);
             }
             echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?" . ">\n";
             echo trim($s_captured_output);
             echo trim($this->s_content);
             echo $sText;
             $this->m_bHeaderSent = true;
         }
     }
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:20,代码来源:xmlpage.class.inc.php

示例4: Render

 public function Render(WebPage $oPage, $aParams = array())
 {
     $this->m_sTemplate = MetaModel::ApplyParams($this->m_sTemplate, $aParams);
     $iStart = 0;
     $iEnd = strlen($this->m_sTemplate);
     $iCount = 0;
     $iBeforeTagPos = $iStart;
     $iAfterTagPos = $iStart;
     while ($sTag = $this->GetNextTag($iStart, $iEnd)) {
         $sContent = $this->GetTagContent($sTag, $iStart, $iEnd);
         $iAfterTagPos = $iEnd + strlen('</' . $sTag . '>');
         $sOuterTag = substr($this->m_sTemplate, $iStart, $iAfterTagPos - $iStart);
         $oPage->add(substr($this->m_sTemplate, $iBeforeTagPos, $iStart - $iBeforeTagPos));
         if ($sTag == DisplayBlock::TAG_BLOCK) {
             try {
                 $oBlock = DisplayBlock::FromTemplate($sOuterTag);
                 if (is_object($oBlock)) {
                     $oBlock->Display($oPage, 'block_' . self::$iBlockCount, $aParams);
                 }
             } catch (OQLException $e) {
                 $oPage->p('Error in template (please contact your administrator) - Invalid query<!--' . $sOuterTag . '-->');
             } catch (Exception $e) {
                 $oPage->p('Error in template (please contact your administrator)<!--' . $e->getMessage() . '--><!--' . $sOuterTag . '-->');
             }
             self::$iBlockCount++;
         } else {
             $aAttributes = $this->GetTagAttributes($sTag, $iStart, $iEnd);
             //$oPage->p("Tag: $sTag - ($iStart, $iEnd)");
             $this->RenderTag($oPage, $sTag, $aAttributes, $sContent);
         }
         $iAfterTagPos = $iEnd + strlen('</' . $sTag . '>');
         $iBeforeTagPos = $iAfterTagPos;
         $iStart = $iEnd;
         $iEnd = strlen($this->m_sTemplate);
         $iCount++;
     }
     $oPage->add(substr($this->m_sTemplate, $iAfterTagPos));
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:38,代码来源:template.class.inc.php

示例5: RenderContent

 public function RenderContent(WebPage $oPage, $aExtraParams = array())
 {
     if (empty($aExtraParams['currentId'])) {
         $sId = 'sqlblock_' . $oPage->GetUniqueId();
         // Works only if the page is not an Ajax one !
     } else {
         $sId = $aExtraParams['currentId'];
     }
     //		$oPage->add($this->GetRenderContent($oPage, $aExtraParams, $sId));
     $sQuery = $this->BuildQuery();
     $res = CMDBSource::Query($sQuery);
     $aQueryCols = CMDBSource::GetColumns($res);
     // Prepare column definitions (check + give default values)
     //
     foreach ($this->m_aColumns as $sName => $aColumnData) {
         if (!in_array($sName, $aQueryCols)) {
             throw new Exception("Unknown column name '{$sName}' in sqlblock column");
         }
         if (!isset($aColumnData['label'])) {
             $this->m_aColumns[$sName]['label'] = $sName;
         }
         if (isset($aColumnData['drilldown']) && !empty($aColumnData['drilldown'])) {
             // Check if the OQL is valid
             try {
                 $this->m_aColumns[$sName]['filter'] = DBObjectSearch::FromOQL($aColumnData['drilldown']);
             } catch (OQLException $e) {
                 unset($aColumnData['drilldown']);
             }
         }
     }
     if (strlen($this->m_sTitle) > 0) {
         $oPage->add("<h2>" . Dict::S($this->m_sTitle) . "</h2>\n");
     }
     switch ($this->m_sType) {
         case 'bars':
         case 'pie':
             $aColNames = array_keys($this->m_aColumns);
             $sXColName = $aColNames[0];
             $sYColName = $aColNames[1];
             $aData = array();
             $aRows = array();
             while ($aRow = CMDBSource::FetchArray($res)) {
                 $aData[$aRow[$sXColName]] = $aRow[$sYColName];
                 $aRows[$aRow[$sXColName]] = $aRow;
             }
             $this->RenderChart($oPage, $sId, $aData, $this->m_aColumns[$sYColName]['drilldown'], $aRows);
             break;
         default:
         case 'table':
             $oAppContext = new ApplicationContext();
             $sContext = $oAppContext->GetForLink();
             if (!empty($sContext)) {
                 $sContext = '&' . $sContext;
             }
             $aDisplayConfig = array();
             foreach ($this->m_aColumns as $sName => $aColumnData) {
                 $aDisplayConfig[$sName] = array('label' => $aColumnData['label'], 'description' => '');
             }
             $aDisplayData = array();
             while ($aRow = CMDBSource::FetchArray($res)) {
                 $aSQLColNames = array_keys($aRow);
                 $aDisplayRow = array();
                 foreach ($this->m_aColumns as $sName => $aColumnData) {
                     if (isset($aColumnData['filter'])) {
                         $sFilter = $aColumnData['drilldown'];
                         $sClass = $aColumnData['filter']->GetClass();
                         $sFilter = str_replace('SELECT ' . $sClass, '', $sFilter);
                         foreach ($aSQLColNames as $sColName) {
                             $sFilter = str_replace(':' . $sColName, "'" . addslashes($aRow[$sColName]) . "'", $sFilter);
                         }
                         $sURL = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?operation=search_oql&search_form=0&oql_class=' . $sClass . '&oql_clause=' . urlencode($sFilter) . '&format=html' . $sContext;
                         $aDisplayRow[$sName] = '<a href="' . $sURL . '">' . $aRow[$sName] . "</a>";
                     } else {
                         $aDisplayRow[$sName] = $aRow[$sName];
                     }
                 }
                 $aDisplayData[] = $aDisplayRow;
             }
             $oPage->table($aDisplayConfig, $aDisplayData);
             break;
     }
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:82,代码来源:sqlblock.class.inc.php

示例6: DisplayImportHistory

    /**
     * Display the history of bulk imports
     */
    static function DisplayImportHistory(WebPage $oPage, $bFromAjax = false, $bShowAll = false)
    {
        $sAjaxDivId = "CSVImportHistory";
        if (!$bFromAjax) {
            $oPage->add('<div id="' . $sAjaxDivId . '">');
        }
        $oPage->p(Dict::S('UI:History:BulkImports+') . ' <span id="csv_history_reload"></span>');
        $oBulkChangeSearch = DBObjectSearch::FromOQL("SELECT CMDBChange WHERE origin IN ('csv-interactive', 'csv-import.php')");
        $iQueryLimit = $bShowAll ? 0 : appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
        $oBulkChanges = new DBObjectSet($oBulkChangeSearch, array('date' => false), array(), null, $iQueryLimit);
        $oAppContext = new ApplicationContext();
        $bLimitExceeded = false;
        if ($oBulkChanges->Count() > appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit())) {
            $bLimitExceeded = true;
            if (!$bShowAll) {
                $iMaxObjects = appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
                $oBulkChanges->SetLimit($iMaxObjects);
            }
        }
        $oBulkChanges->Seek(0);
        $aDetails = array();
        while ($oChange = $oBulkChanges->Fetch()) {
            $sDate = '<a href="csvimport.php?step=10&changeid=' . $oChange->GetKey() . '&' . $oAppContext->GetForLink() . '">' . $oChange->Get('date') . '</a>';
            $sUser = $oChange->GetUserName();
            if (preg_match('/^(.*)\\(CSV\\)$/i', $oChange->Get('userinfo'), $aMatches)) {
                $sUser = $aMatches[1];
            } else {
                $sUser = $oChange->Get('userinfo');
            }
            $oOpSearch = DBObjectSearch::FromOQL("SELECT CMDBChangeOpCreate WHERE change = :change_id");
            $oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $oChange->GetKey()));
            $iCreated = $oOpSet->Count();
            // Get the class from the first item found (assumption: a CSV load is done for a single class)
            if ($oCreateOp = $oOpSet->Fetch()) {
                $sClass = $oCreateOp->Get('objclass');
            }
            $oOpSearch = DBObjectSearch::FromOQL("SELECT CMDBChangeOpSetAttribute WHERE change = :change_id");
            $oOpSet = new DBObjectSet($oOpSearch, array(), array('change_id' => $oChange->GetKey()));
            $aModified = array();
            $aAttList = array();
            while ($oModified = $oOpSet->Fetch()) {
                // Get the class (if not done earlier on object creation)
                $sClass = $oModified->Get('objclass');
                $iKey = $oModified->Get('objkey');
                $sAttCode = $oModified->Get('attcode');
                $aAttList[$sClass][$sAttCode] = true;
                $aModified["{$sClass}::{$iKey}"] = true;
            }
            $iModified = count($aModified);
            // Assumption: there is only one class of objects being loaded
            // Then the last class found gives us the class for every object
            if ($iModified > 0 || $iCreated > 0) {
                $aDetails[] = array('date' => $sDate, 'user' => $sUser, 'class' => $sClass, 'created' => $iCreated, 'modified' => $iModified);
            }
        }
        $aConfig = array('date' => array('label' => Dict::S('UI:History:Date'), 'description' => Dict::S('UI:History:Date+')), 'user' => array('label' => Dict::S('UI:History:User'), 'description' => Dict::S('UI:History:User+')), 'class' => array('label' => Dict::S('Core:AttributeClass'), 'description' => Dict::S('Core:AttributeClass+')), 'created' => array('label' => Dict::S('UI:History:StatsCreations'), 'description' => Dict::S('UI:History:StatsCreations+')), 'modified' => array('label' => Dict::S('UI:History:StatsModifs'), 'description' => Dict::S('UI:History:StatsModifs+')));
        if ($bLimitExceeded) {
            if ($bShowAll) {
                // Collapsible list
                $oPage->add('<p>' . Dict::Format('UI:CountOfResults', $oBulkChanges->Count()) . '&nbsp;&nbsp;<a class="truncated" onclick="OnTruncatedHistoryToggle(false);">' . Dict::S('UI:CollapseList') . '</a></p>');
            } else {
                // Truncated list
                $iMinDisplayLimit = appUserPreferences::GetPref('default_page_size', MetaModel::GetConfig()->GetMinDisplayLimit());
                $sCollapsedLabel = Dict::Format('UI:TruncatedResults', $iMinDisplayLimit, $oBulkChanges->Count());
                $sLinkLabel = Dict::S('UI:DisplayAll');
                $oPage->add('<p>' . $sCollapsedLabel . '&nbsp;&nbsp;<a class="truncated" onclick="OnTruncatedHistoryToggle(true);">' . $sLinkLabel . '</p>');
                $oPage->add_ready_script(<<<EOF
\t\$('#{$sAjaxDivId} table.listResults').addClass('truncated');
\t\$('#{$sAjaxDivId} table.listResults tr:last td').addClass('truncated');
EOF
);
                $sAppContext = $oAppContext->GetForLink();
                $oPage->add_script(<<<EOF
\tfunction OnTruncatedHistoryToggle(bShowAll)
\t{
\t\t\$('#csv_history_reload').html('<img src="../images/indicator.gif"/>');
\t\t\$.get(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?{$sAppContext}', {operation: 'displayCSVHistory', showall: bShowAll}, function(data)
\t\t\t{
\t\t\t\t\$('#{$sAjaxDivId}').html(data);
\t\t\t\tvar table = \$('#{$sAjaxDivId} .listResults');
\t\t\t\ttable.tableHover(); // hover tables
\t\t\t\ttable.tablesorter( { widgets: ['myZebra', 'truncatedList']} ); // sortable and zebra tables
\t\t\t}
\t\t);
\t}
EOF
);
            }
        } else {
            // Normal display - full list without any decoration
        }
        $oPage->table($aConfig, $aDetails);
        if (!$bFromAjax) {
            $oPage->add('</div>');
        }
    }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:99,代码来源:bulkchange.class.inc.php

示例7: RenderContent

    public function RenderContent(WebPage $oPage, $aExtraParams = array())
    {
        $oDashboard = $this->GetDashboard();
        if ($oDashboard != null) {
            $sDivId = preg_replace('/[^a-zA-Z0-9_]/', '', $this->sMenuId);
            $oPage->add('<div class="dashboard_contents" id="' . $sDivId . '">');
            $oDashboard->Render($oPage, false, $aExtraParams);
            $oPage->add('</div>');
            $oDashboard->RenderEditionTools($oPage);
            if ($oDashboard->GetAutoReload()) {
                $sId = $this->sMenuId;
                $sExtraParams = json_encode($aExtraParams);
                $iReloadInterval = 1000 * $oDashboard->GetAutoReloadInterval();
                $oPage->add_script(<<<EOF
\t\t\t\t\tsetInterval("ReloadDashboard('{$sDivId}');", {$iReloadInterval});

\t\t\t\t\tfunction ReloadDashboard(sDivId)
\t\t\t\t\t{
\t\t\t\t\t\tvar oExtraParams = {$sExtraParams};
\t\t\t\t\t\t// Do not reload when a dialog box is active
\t\t\t\t\t\tif (!(\$('.ui-dialog:visible').length > 0))
\t\t\t\t\t\t{
\t\t\t\t\t\t\t\$('.dashboard_contents#'+sDivId).block();
\t\t\t\t\t\t\t\$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
\t\t\t\t\t\t\t   { operation: 'reload_dashboard', dashboard_id: '{$sId}', extra_params: oExtraParams},
\t\t\t\t\t\t\t   function(data){
\t\t\t\t\t\t\t\t \$('.dashboard_contents#'+sDivId).html(data);
\t\t\t\t\t\t\t\t \$('.dashboard_contents#'+sDivId).unblock();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t );
\t\t\t\t\t\t}
\t\t\t\t\t}
EOF
);
            }
            $bEdit = utils::ReadParam('edit', false);
            if ($bEdit) {
                $sId = addslashes($this->sMenuId);
                $oPage->add_ready_script("EditDashboard('{$sId}');");
            }
        } else {
            $oPage->p("Error: failed to load dashboard file: '{$this->sDashboardFile}'");
        }
    }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:44,代码来源:menunode.class.inc.php

示例8: DisplayForm

function DisplayForm(WebPage $oP, $sAction = '', $sExpression = '', $sQueryId = '', $sFormat = null)
{
    $oExportSearch = null;
    $oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/tabularfieldsselector.js');
    $oP->add_linked_script(utils::GetAbsoluteUrlAppRoot() . 'js/jquery.dragtable.js');
    $oP->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot() . 'css/dragtable.css');
    $oP->add('<form id="export-form" action="' . $sAction . '" method="post" data-state="not-yet-started">');
    $bExpressionIsValid = true;
    $sExpressionError = '';
    if ($sExpression === null && $sQueryId === null) {
        $bExpressionIsValid = false;
    } else {
        if ($sExpression !== '') {
            try {
                $oExportSearch = DBObjectSearch::FromOQL($sExpression);
            } catch (OQLException $e) {
                $bExpressionIsValid = false;
                $sExpressionError = $e->getMessage();
            }
        }
    }
    if (!$bExpressionIsValid) {
        DisplayExpressionForm($oP, $sAction, $sExpression, $sExpressionError);
        return;
    }
    if ($sExpression !== '') {
        $oP->add('<input type="hidden" name="expression" value="' . htmlentities($sExpression, ENT_QUOTES, 'UTF-8') . '">');
        $oExportSearch = DBObjectSearch::FromOQL($sExpression);
    } else {
        $oQuery = MetaModel::GetObject('QueryOQL', $sQueryId);
        $oExportSearch = DBObjectSearch::FromOQL($oQuery->Get('oql'));
        $oP->add('<input type="hidden" name="query" value="' . htmlentities($sQueryId, ENT_QUOTES, 'UTF-8') . '">');
    }
    $aFormPartsByFormat = array();
    $aAllFormParts = array();
    if ($sFormat == null) {
        // No specific format chosen
        $sDefaultFormat = utils::ReadParam('format', 'xlsx');
        $oP->add('<p>' . Dict::S('Core:BulkExport:ExportFormatPrompt') . ' <select name="format" id="format_selector">');
        $aSupportedFormats = BulkExport::FindSupportedFormats();
        asort($aSupportedFormats);
        foreach ($aSupportedFormats as $sFormatCode => $sLabel) {
            $sSelected = $sFormatCode == $sDefaultFormat ? 'selected' : '';
            $oP->add('<option value="' . $sFormatCode . '" ' . $sSelected . '>' . htmlentities($sLabel, ENT_QUOTES, 'UTF-8') . '</option>');
            $oExporter = BulkExport::FindExporter($sFormatCode);
            $oExporter->SetObjectList($oExportSearch);
            $aParts = $oExporter->EnumFormParts();
            foreach ($aParts as $sPartId => $void) {
                $aAllFormParts[$sPartId] = $oExporter;
            }
            $aFormPartsByFormat[$sFormatCode] = array_keys($aParts);
        }
        $oP->add('</select></p>');
    } else {
        // One specific format was chosen
        $oP->add('<input type="hidden" name="format" value="' . htmlentities($sFormat, ENT_QUOTES, 'UTF-8') . '">');
        $oExporter = BulkExport::FindExporter($sFormat, $oExportSearch);
        $aParts = $oExporter->EnumFormParts();
        foreach ($aParts as $sPartId => $void) {
            $aAllFormParts[$sPartId] = $oExporter;
        }
        $aFormPartsByFormat[$sFormat] = array_keys($aAllFormParts);
    }
    foreach ($aAllFormParts as $sPartId => $oExport) {
        $oP->add('<div class="form_part" id="form_part_' . $sPartId . '">');
        $oExport->DisplayFormPart($oP, $sPartId);
        $oP->add('</div>');
    }
    $oP->add('</form>');
    $oP->add('<div id="export-feedback" style="display:none;"><p class="export-message" style="text-align:center;">' . Dict::S('ExcelExport:PreparingExport') . '</p><div class="export-progress-bar" style="max-width:30em; margin-left:auto;margin-right:auto;"><div class="export-progress-message" style="text-align:center;"></div></div></div>');
    $oP->add('<button type="button" id="export-btn">' . Dict::S('UI:Button:Export') . '</button>');
    $oP->add('<div id="export_text_result" style="display:none;">');
    $oP->add('<div>' . Dict::S('Core:BulkExport:ExportResult') . '</div>');
    $oP->add('<textarea id="export_content" style="width:100%;min-height:15em;"></textarea>');
    $oP->add('</div>');
    $sJSParts = json_encode($aFormPartsByFormat);
    $sJSCancel = json_encode(Dict::S('UI:Button:Cancel'));
    $sJSClose = json_encode(Dict::S('UI:Button:Done'));
    $oP->add_ready_script(<<<EOF
window.aFormParts = {$sJSParts};
\$('#format_selector').on('change init', function() {
\tExportToggleFormat(\$(this).val());
}).trigger('init');
\t\t
\$('.export-progress-bar').progressbar({
\t value: 0,
\t change: function() {
\t\t\$('.export-progress-message').text( \$(this).progressbar( "value" ) + "%" );
\t },
\t complete: function() {
\t\t \$('.export-progress-message').text( '100 %' );
\t }
});

ExportInitButton('#export-btn');

EOF
);
}
开发者ID:henryavila,项目名称:itop,代码行数:99,代码来源:export-v2.php

示例9: DisplayBareProperties

 function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
 {
     if ($bEditMode) {
         return;
     }
     // Not editable
     $oPage->add('<table style="vertical-align:top"><tr style="vertical-align:top"><td>');
     $aDetails = array();
     $sClass = get_class($this);
     $oPage->add('<fieldset>');
     $oPage->add('<legend>' . Dict::S('Core:SynchroReplica:PrivateDetails') . '</legend>');
     $aZList = MetaModel::FlattenZlist(MetaModel::GetZListItems($sClass, 'details'));
     foreach ($aZList as $sAttCode) {
         $sDisplayValue = $this->GetAsHTML($sAttCode);
         $aDetails[] = array('label' => '<span title="' . MetaModel::GetDescription($sClass, $sAttCode) . '">' . MetaModel::GetLabel($sClass, $sAttCode) . '</span>', 'value' => $sDisplayValue);
     }
     $oPage->Details($aDetails);
     $oPage->add('</fieldset>');
     if (strlen($this->Get('dest_class')) > 0) {
         $oDestObj = MetaModel::GetObject($this->Get('dest_class'), $this->Get('dest_id'), false);
         if (is_object($oDestObj)) {
             $oPage->add('<fieldset>');
             $oPage->add('<legend>' . Dict::Format('Core:SynchroReplica:TargetObject', $oDestObj->GetHyperlink()) . '</legend>');
             $oDestObj->DisplayBareProperties($oPage, false, $sPrefix, $aExtraParams);
             $oPage->add('<fieldset>');
         }
     }
     $oPage->add('</td><td>');
     $oPage->add('<fieldset>');
     $oPage->add('<legend>' . Dict::S('Core:SynchroReplica:PublicData') . '</legend>');
     $oSource = MetaModel::GetObject('SynchroDataSource', $this->Get('sync_source_id'));
     $sSQLTable = $oSource->GetDataTable();
     $aData = $this->LoadExtendedDataFromTable($sSQLTable);
     $aHeaders = array('attcode' => array('label' => 'Attribute Code', 'description' => ''), 'data' => array('label' => 'Value', 'description' => ''));
     $aRows = array();
     foreach ($aData as $sKey => $value) {
         $aRows[] = array('attcode' => $sKey, 'data' => $value);
     }
     $oPage->Table($aHeaders, $aRows);
     $oPage->add('</fieldset>');
     $oPage->add('</td></tr></table>');
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:42,代码来源:synchrodatasource.class.inc.php

示例10: RenderContent

 public function RenderContent(WebPage $oPage, $aExtraParams = array())
 {
     if (!isset($aExtraParams['currentId'])) {
         $sId = $oPage->GetUniqueId();
         // Works only if the page is not an Ajax one !
     } else {
         $sId = $aExtraParams['currentId'];
     }
     $oPage->add($this->GetRenderContent($oPage, $aExtraParams, $sId));
 }
开发者ID:henryavila,项目名称:itop,代码行数:10,代码来源:displayblock.class.inc.php

示例11: while

                    do {
                        $aStatus = $oExporter->Run();
                        // process one chunk
                    } while ($aStatus['code'] != 'done' && $aStatus['code'] != 'error');
                    if ($aStatus['code'] == 'done') {
                        $oP->SetContentType('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
                        $oP->SetContentDisposition('attachment', $oFilter->GetClass() . '.xlsx');
                        $oP->add(file_get_contents($oExporter->GetExcelFilePath()));
                        $oExporter->Cleanup();
                    } else {
                        $oP->add('Error, xlsx export failed: ' . $aStatus['message']);
                    }
                    break;
                default:
                    $oP = new WebPage("iTop - Export");
                    $oP->add("Unsupported format '{$sFormat}'. Possible values are: html, csv, spreadsheet or xml.");
            }
        }
    } catch (Exception $e) {
        $oP = new WebPage("iTop - Export");
        $oP->p("Error the query can not be executed.");
        if ($e instanceof CoreException) {
            $oP->p($e->GetHtmlDesc());
        } else {
            $oP->p($e->getMessage());
        }
    }
}
if (!$oP) {
    // Display a short message about how to use this page
    $bModeCLI = utils::IsModeCLI();
开发者ID:henryavila,项目名称:itop,代码行数:31,代码来源:export.php

示例12: MakeStimulusForm

/**
 * Create form to apply a stimulus
 * @param WebPage $oP The current web page
 * @param Object $oObj The target object
 * @param String $sStimulusCode Stimulus that will be applied
 * @param Array $aEditAtt List of attributes to edit
 * @return void
 */
function MakeStimulusForm(WebPage $oP, $oObj, $sStimulusCode, $aEditAtt)
{
    static $bHasStimulusForm = false;
    $sDialogId = $sStimulusCode . "_dialog";
    $sFormId = $sStimulusCode . "_form";
    $sCancelButtonLabel = Dict::S('UI:Button:Cancel');
    $oP->add('<div id="' . $sDialogId . '" style="display: none;">');
    $sClass = get_class($oObj);
    $oP->add('<form id="' . $sFormId . '" method="post">');
    $sTransactionId = utils::GetNewTransactionId();
    $oP->add("<input type=\"hidden\" id=\"transaction_id\" name=\"transaction_id\" value=\"{$sTransactionId}\">\n");
    $oP->add("<input type=\"hidden\" name=\"class\" value=\"{$sClass}\">");
    $oP->add("<input type=\"hidden\" name=\"id\" value=\"" . $oObj->GetKey() . "\">");
    $oP->add("<input type=\"hidden\" name=\"operation\" value=\"update_request\">");
    $oP->add("<input type=\"hidden\" id=\"stimulus_to_apply\" name=\"apply_stimulus\" value=\"{$sStimulusCode}\">\n");
    foreach ($aEditAtt as $sAttCode) {
        $sValue = $oObj->Get($sAttCode);
        $sDisplayValue = $oObj->GetEditValue($sAttCode);
        $aArgs = array('this' => $oObj, 'formPrefix' => '');
        $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
        $sInputId = 'input_' . $sAttCode;
        $sHTMLValue = "<span id=\"field_{$sStimulusCode}_{$sInputId}\">" . cmdbAbstractObject::GetFormElementForField($oP, $sClass, $sAttCode, $oAttDef, $sValue, $sDisplayValue, $sInputId, '', 0, $aArgs) . '</span>';
        $oP->add('<h1>' . MetaModel::GetLabel($sClass, $sAttCode) . '</h1>');
        $oP->add($sHTMLValue);
    }
    $oP->add('</form>');
    $oP->add('</div>');
    if (!$bHasStimulusForm) {
        $bHasStimulusForm = true;
        $oP->add_script(<<<EOF

function RunStimulusDialog(sStimulusCode, sTitle, sOkButtonLabel)
{
\tvar sWidth = 'auto';
\tif (sStimulusCode == 'ev_reopen')
\t{
\t\t// Avoid having a dialog spanning the complete width of the window
\t\t// just because it contains a CaseLog entry
\t\tsWidth = '80%';
\t}
\t\t\t\t
\t\$('#'+sStimulusCode+'_dialog').dialog({
\t\theight: 'auto',
\t\twidth: sWidth,
\t\tmodal: true,
\t\ttitle: sTitle,
\t\tbuttons: [
\t\t{ text: sOkButtonLabel, click: function() {
\t\t\t\$(this).find('#'+sStimulusCode+'_form').submit();
\t\t} },
\t\t{ text: "{$sCancelButtonLabel}", click: function() {
\t\t\t\$(this).dialog( "close" );
\t\t} }
\t\t]
\t});
\t// Start the validation
\tCheckFields(sStimulusCode+'_form', false);
\t\$('#'+sStimulusCode+'_form').submit( function() {
\t\treturn OnSubmit(sStimulusCode+'_form');
\t});
}
EOF
);
    }
}
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:73,代码来源:index.php

示例13: DoAddObjects

 public function DoAddObjects(WebPage $oP, $oFullSetFilter)
 {
     $aLinkedObjectIds = utils::ReadMultipleSelection($oFullSetFilter);
     foreach ($aLinkedObjectIds as $iObjectId) {
         $oLinkObj = MetaModel::GetObject($this->sLinkedClass, $iObjectId);
         $oP->add($this->GetObjectRow($oP, $oLinkObj, $oLinkObj->GetKey()));
     }
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:8,代码来源:ui.linksdirectwidget.class.inc.php

示例14: DisplayFormPart

 public function DisplayFormPart(WebPage $oP, $sPartId)
 {
     switch ($sPartId) {
         case 'pdf_options':
             $oP->add('<fieldset><legend>' . Dict::S('Core:BulkExport:PDFOptions') . '</legend>');
             $oP->add('<table>');
             $oP->add('<tr>');
             $oP->add('<td>' . Dict::S('Core:BulkExport:PDFPageSize') . '</td>');
             $oP->add('<td>' . $this->GetSelectCtrl('page_size', array('A3', 'A4', 'Letter'), 'Core:BulkExport:PageSize-', 'A4') . '</td>');
             $oP->add('</tr>');
             $oP->add('<td>' . Dict::S('Core:BulkExport:PDFPageOrientation') . '</td>');
             $oP->add('<td>' . $this->GetSelectCtrl('page_orientation', array('P', 'L'), 'Core:BulkExport:PageOrientation-', 'L') . '</td>');
             $oP->add('</tr>');
             $oP->add('</table>');
             $oP->add('</fieldset>');
             break;
         default:
             return parent::DisplayFormPart($oP, $sPartId);
     }
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:20,代码来源:pdfbulkexport.class.inc.php

示例15: WebPage

require_once APPROOT . '/application/ajaxwebpage.class.inc.php';
require_once APPROOT . '/application/startup.inc.php';
$operation = utils::ReadParam('operation', '');
require_once APPROOT . '/application/loginwebpage.class.inc.php';
LoginWebPage::DoLogin();
// Check user rights and prompt if needed
$oP = new WebPage('Replay queries.log');
ini_set('memory_limit', '512M');
require_once APPROOT . '/data/queries.log';
$iCount = count($aQueriesLog);
$oP->p("Nombre de requêtes: " . $iCount);
$sOperation = utils::ReadParam('operation', '');
switch ($sOperation) {
    case '':
    default:
        $oP->add("<ol>\n");
        foreach ($aQueriesLog as $sQueryId => $aOqlData) {
            $sOql = $aOqlData['oql'];
            $sOqlHtml = htmlentities($sOql, ENT_QUOTES, 'UTF-8');
            $oP->add("<li>{$sOqlHtml} <a href=\"?operation=zoom&query={$sQueryId}\">zoom</a></li>\n");
        }
        $oP->add("</ol>\n");
        $oP->add("<form action=\"?operation=benchmark&repeat=3\" method=\"post\">\n");
        $oP->add("<input type=\"submit\" value=\"Benchmark (3 repeats)!\">\n");
        $oP->add("</form>\n");
        $oP->add("<form action=\"?operation=check\" method=\"post\">\n");
        $oP->add("<input type=\"submit\" value=\"Check!\">\n");
        $oP->add("</form>\n");
        break;
    case 'zoom':
        $sQueryId = utils::ReadParam('query', '', false, 'raw_data');
开发者ID:besmirzanaj,项目名称:itop-code,代码行数:31,代码来源:replay_query_log.php


注:本文中的WebPage::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。