public function printTree()
 {
     print "<a class=\"pseudoLink\" onclick=\"javascript:ddtreemenu.flatten('{$this->name}', 'expand'); return false;\">Expand All</a> | " . "<a class=\"pseudoLink\" onclick=\"javascript:ddtreemenu.flatten('{$this->name}', 'collapse'); return false;\">Collapse All</a>\n";
     if (isset($this->additionalMenus)) {
         print $this->additionalMenus;
     }
     print "<ul id='{$this->name}' class='treeview'>";
     $this->printNode($this->nodes);
     print "</ul>\n";
     addFooterScript("<script type='text/javascript' src='" . getPathToStaticResource('/script/simpletreemenu.js') . "'>\n" . "/***********************************************\n" . "* Dynamic Countdown script- © Dynamic Drive (http://www.dynamicdrive.com)\n" . "* This notice MUST stay intact for legal use\n" . "* Visit http://www.dynamicdrive.com/ for this script and 100s more.\n" . "***********************************************/\n" . "</script>");
     addFooterScript("<script type='text/javascript'>" . "ddtreemenu.createTree('{$this->name}', true);" . ($this->forceCollapse ? "ddtreemenu.flatten('{$this->name}', 'collapse');" : "") . "</script>");
 }
Example #2
0
?>
                </select>
            </p>
        </div>

        <div class="loginType_std loginType_oauth loginType_adv">
            <?php 
if ($c->getTermsFile()) {
    ?>
            <div style="margin-left: 95px;">
                <input type="checkbox" id="termsAccepted" name="termsAccepted"/>
                <label for="termsAccepted"><a href="terms.php" target="_blank">I agree to the terms of service</a></label>
            </div>
            <?php 
}
?>

            <p>
                <div style="text-align: right;">
                    <input type="submit" id="loginBtn" name="uiLogin" value="Login">
                </div>
            </p>
        </div>
    </form>
</div>
    
<?php 
addFooterScript("<script type='text/javascript' src='" . getPathToStaticResource('/script/login.js') . "'></script>");
addFooterScript("<script type='text/javascript'>wbLoginConfig=" . $c->getJsConfig() . "</script>");
addFooterScript("<script type='text/javascript'>WorkbenchLogin.initializeForm('" . htmlspecialchars($c->getLoginType()) . "');</script>");
require_once "footer.php";
Example #3
0
    </p>
    
    <input type='submit' name='select' value='Select'/>
</form>

<script type="text/javascript">
    function toggleObjectSelectDisabled() {
        var usesObject = new Array();
        <?php 
foreach ($GLOBALS["MENUS"] as $menu => $pages) {
    foreach ($pages as $href => $page) {
        if ($page->onMenuSelect === 'usesObject') {
            print "usesObject['{$href}'] = '{$href}';\n";
        }
    }
}
?>

        var actionJumpVal = document.getElementById('actionJump').value;

        if (usesObject[actionJumpVal] != undefined) {
            document.getElementById('default_object').disabled = false;
        } else {
            document.getElementById('default_object').disabled = true;
        }
    }
</script>

<?php 
addFooterScript("<script type='text/javascript'>toggleObjectSelectDisabled();</script>");
include_once 'footer.php';
Example #4
0
                       value="Delete"/>

                <span id="waitingIndicator">
                    <img src="<?php 
echo getPathToStaticResource('/images/wait16trans.gif');
?>
"/>
                    Processing...
                </span>
            </div>
        </form>
    </div>
</div>

<div id="streamContainer">
    <div><span id="status"></span><span id="pollIndicator">&bull;</span></div>
    <div id="streamBody"></div>
</div>

<script type="text/javascript">

</script>


<?php 
if ($c->isEnabled()) {
    addFooterScript("<script type='text/javascript' src='" . 'static-unversioned/script/dojo/dojo/dojo.js' . "'></script>");
    addFooterScript("<script type='text/javascript' src='" . getPathToStaticResource('/script/streamingClient.js') . "'></script>");
    addFooterScript("<script type='text/javascript'>var wbStreaming = " . $c->getStreamingConfig() . ";</script>");
}
require_once "footer.php";
 function displayQueryResults($records, $queryTimeElapsed, QueryRequest $queryRequest)
 {
     if (is_numeric($records)) {
         $countString = "Query would return {$records} record";
         $countString .= $records == 1 ? "." : "s.";
         displayInfo($countString);
         return;
     }
     if (!$records) {
         displayWarning("Sorry, no records returned.");
         return;
     }
     if (WorkbenchConfig::get()->value("areTablesSortable")) {
         addFooterScript("<script type='text/javascript' src='" . getPathToStaticResource('/script/sortable.js') . "></script>");
     }
     print "<a name='qr'></a><div style='clear: both;'><br/><h2>Query Results</h2>\n";
     if (isset($this->queryLocator)) {
         preg_match("/-(\\d+)/", $this->queryLocator, $lastRecord);
         $rowOffset = $lastRecord[1];
     } else {
         $rowOffset = 0;
     }
     $minRowNum = $rowOffset + 1;
     $maxRowNum = $rowOffset + count($records);
     print "<p>Returned records {$minRowNum} - {$maxRowNum} of " . $this->totalQuerySize . " total record" . ($this->totalQuerySize !== 1 ? "s" : "") . " in " . sprintf("%01.3f", $queryTimeElapsed) . " seconds:</p>\n";
     if (!WorkbenchConfig::get()->value("autoRunQueryMore") && $this->nextQueryLocator) {
         print "<p><input type='hidden' name='queryLocator' value='" . $this->nextQueryLocator . "' /></p>\n";
         print "<p><input type='submit' name='queryMore' id='queryMoreButtonTop' value='More...' /></p>\n";
     }
     print addLinksToIds($queryRequest->getExportTo() == 'matrix' ? $this->createQueryResultsMatrix($records, $queryRequest->getMatrixCols(), $queryRequest->getMatrixRows()) : $this->createQueryResultTable($records, $minRowNum));
     if (!WorkbenchConfig::get()->value("autoRunQueryMore") && $this->nextQueryLocator) {
         print "<p><input type='hidden' name='queryLocator' value='" . $this->nextQueryLocator . "' /></p>\n";
         print "<p><input type='submit' name='queryMore' id='queryMoreButtonBottom' value='More...' /></p>";
     }
     print "</form></div>\n";
 }
Example #6
0
function displaySearchResult($records, $searchTimeElapsed)
{
    //Check if records were returned
    if ($records) {
        if (WorkbenchConfig::get()->value("areTablesSortable")) {
            addFooterScript("<script type='text/javascript' src='" . getPathToStaticResource('/script/sortable.js') . "></script>");
        }
        try {
            print "<a name='sr'></a><div style='clear: both;'><br/><h2>Search Results</h2>\n";
            print "<p>Returned " . count($records) . " total record";
            if (count($records) !== 1) {
                print 's';
            }
            print " in ";
            printf("%01.3f", $searchTimeElapsed);
            print " seconds:</p>";
            $searchResultArray = array();
            foreach ($records as $record) {
                $recordObject = new Sobject($record->record);
                $searchResultArray[$recordObject->type][] = $recordObject;
            }
            foreach ($searchResultArray as $recordSetName => $records) {
                echo "<h3>{$recordSetName}</h3>";
                print "<table id='" . $recordSetName . "_results' class='" . getTableClass() . "'>\n";
                //Print the header row on screen
                $record0 = $records[0];
                print "<tr><th></th>";
                //If the user queried for the Salesforce ID, this special method is nessisary
                //to export it from the nested SOAP message. This will always be displayed
                //in the first column regardless of search order
                if (isset($record0->Id)) {
                    print "<th>Id</th>";
                }
                if ($record0->fields) {
                    foreach ($record0->fields->children() as $field) {
                        print "<th>";
                        print htmlspecialchars($field->getName(), ENT_QUOTES);
                        print "</th>";
                    }
                } else {
                    print "</td></tr>";
                }
                print "</tr>\n";
                //Print the remaining rows in the body
                $rowNum = 1;
                foreach ($records as $record) {
                    print "<tr><td>{$rowNum}</td>";
                    $rowNum++;
                    //Another check if there are ID columns in the body
                    if (isset($record->Id)) {
                        print "<td>" . addLinksToIds($record->Id) . "</td>";
                    }
                    //Print the non-ID fields
                    if (isset($record->fields)) {
                        foreach ($record->fields as $datum) {
                            print "<td>";
                            if ($datum) {
                                print localizeDateTimes(addLinksToIds(htmlspecialchars($datum, ENT_QUOTES)));
                            } else {
                                print "&nbsp;";
                            }
                            print "</td>";
                        }
                        print "</tr>\n";
                    } else {
                        print "</td></tr>\n";
                    }
                }
                print "</table>&nbsp;<p/>";
            }
            print "</div>\n";
        } catch (Exception $e) {
            $errors = null;
            $errors = $e->getMessage();
            print "<p />";
            displayError($errors, false, true);
        }
    } else {
        print "<p><a name='sr'>&nbsp;</a></p>";
        displayError("Sorry, no records returned.");
    }
    include_once 'footer.php';
}
Example #7
0
function registerShortcut($key, $jsCommand)
{
    addFooterScript("<script type='text/javascript' src='" . getPathToStaticResource('/script/shortcut.js') . "'></script>");
    addFooterScript("<script type='text/javascript'>" . "shortcut.add(" . "'{$key}'," . "function() {\n{$jsCommand}\n}" . ");" . "</script>");
}