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


PHP Bootstrap::json_encode方法代码示例

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


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

示例1: dbConnections

                    $response = $Server->tryConnectServer($type);
                    if ($response->status == 'SUCCESS') {
                        $response = $Server->tryOpenDataBase($type);
                        if ($response->status == 'SUCCESS') {
                            print SUCCESSFULL . ',' . $Server->error;
                        } else {
                            print FAILED . ',' . $Server->error;
                        }
                    } else {
                        print FAILED . ',' . $Server->error;
                    }
                } else {
                    print FAILED . ',' . $Server->error;
                }
                break;
            default:
                print 'finished';
        }
        break;
    case 'showEncodes':
        //G::LoadThirdParty( 'pear/json', 'class.json' );
        //$oJSON = new Services_JSON();
        $engine = $_POST['engine'];
        if ($engine != "0") {
            $dbs = new dbConnections();
            echo Bootstrap::json_encode($dbs->getEncondeList($engine));
        } else {
            echo '[["0","..."]]';
        }
        break;
}
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:dbConnectionsAjax.php

示例2: Cases

            $oCases = new Cases();
            $aCount = $oCases->getAllConditionCasesCount($aTypes, true);
            echo Bootstrap::json_encode($aCount);
        } else {
            echo Bootstrap::json_encode($aTypesID);
        }
        break;
    case "previusJump":
        //require_once 'classes/model/Application.php';
        $oCriteria = new Criteria('workflow');
        $response = array("success" => true);
        $oCriteria->add(ApplicationPeer::APP_NUMBER, $_POST['appNumber']);
        $oDataset = ApplicationPeer::doSelectRS($oCriteria);
        $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $oDataset->next();
        $aApplication = $oDataset->getRow();
        if (is_array($aApplication)) {
            $response['exists'] = true;
        } else {
            $response['exists'] = false;
        }
        echo Bootstrap::json_encode($response);
        break;
    default:
        echo 'default';
}
function getCasesTypeIds()
{
    $aTypes = array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed', 'selfservice', 'to_revise', 'to_reassign');
    return $aTypesID;
}
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:cases_Ajax.php

示例3: isset

    $user = isset($_POST['form']['NW_USERNAME']) ? trim($_POST['form']['NW_USERNAME']) : 'admin';
    $pass = isset($_POST['form']['NW_PASSWORD']) ? $_POST['form']['NW_PASSWORD'] : 'admin';
    $pass1 = isset($_POST['form']['NW_PASSWORD2']) ? $_POST['form']['NW_PASSWORD2'] : 'admin';
    $ao_db_drop = isset($_POST['form']['AO_DB_DROP']) ? true : false;
    $ao_db_wf = isset($_POST['form']['AO_DB_WF']) ? $_POST['form']['AO_DB_WF'] : false;
    $ao_db_rb = isset($_POST['form']['AO_DB_WF']) ? $_POST['form']['AO_DB_WF'] : false;
    $ao_db_rp = isset($_POST['form']['AO_DB_WF']) ? $_POST['form']['AO_DB_WF'] : false;
    $result = $inst->create_site(array('isset' => true, 'name' => $name, 'admin' => array('username' => $user, 'password' => $pass), 'advanced' => array('ao_db_drop' => $ao_db_drop, 'ao_db_wf' => $ao_db_wf, 'ao_db_rb' => $ao_db_rb, 'ao_db_rp' => $ao_db_rp)), $action === 'create' ? true : false);
    $result['result']['admin']['password'] = $pass === $pass1 ? true : false;
    $result['result']['action'] = $action;
    //$json = new Services_JSON();
    /*$ec;
      $ec->created=($new)?true:false;
      $ec->name=$name;
      $ec->message=($new)?"Workspace created":"Workspace already exists or Name invalid";*/
    echo Bootstrap::json_encode($result);
} else {
    global $RBAC;
    switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE')) {
        case -2:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        case -3:
        case -1:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
    }
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:newSite.php

示例4: foreach

    $sendContent[$r]->name = $d;
    $sendContent[$r]->content = null;
    foreach ($G_FORM->fields[$d] as $attribute => $value) {
        switch ($attribute) {
            case 'type':
                $sendContent[$r]->content->{$attribute} = $value;
                break;
            case 'options':
                $sendContent[$r]->content->{$attribute} = toJSArray($value);
                break;
        }
    }
    $sendContent[$r]->value = $G_FORM->values[$d];
    $r++;
}
echo Bootstrap::json_encode($sendContent);
function toJSArray($array)
{
    $result = array();
    foreach ($array as $k => $v) {
        $o = null;
        $o->key = $k;
        $o->value = $v;
        $result[] = $o;
    }
    return $result;
}
function subDependencies($k, &$G_FORM, &$aux)
{
    if (array_search($k, $aux) !== false) {
        return array();
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:fields_Ajax.php

示例5: RenderContent0


//.........这里部分代码省略.........
             G::LoadClass('popupMenu');
             $pm = new popupMenu('gulliver/pagedTable_PopupMenu');
             $sc = $pm->renderPopup($oTable->id, $oTable->fields);
             /* End Block */
             //krumo ( $Part );
             if ($this->ROWS_PER_PAGE) {
                 $oTable->rowsPerPage = $this->ROWS_PER_PAGE;
             }
             try {
                 if (is_array($Part['Data'])) {
                     $oTable->renderTable('', $Part['Data']);
                 } else {
                     $oTable->renderTable();
                 }
                 print $sc;
             } catch (Exception $e) {
                 $aMessage['MESSAGE'] = $e->getMessage();
                 $this->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
             }
             break;
         case 'panel-init':
             global $mainPanelScript;
             global $panelName;
             global $tabCount;
             //G::LoadThirdParty( 'pear/json', 'class.json' );
             //$json = new Services_JSON();
             $tabCount = 0;
             $panelName = $Part['Template'];
             $data = $Part['File'];
             if (!is_array($data)) {
                 $data = array();
             }
             $data = G::array_merges(array('title' => '', 'style' => array(), 'left' => 'getAbsoluteLeft(mycontent)', 'top' => 'getAbsoluteTop(mycontent)', 'width' => 700, 'height' => 600, 'drag' => true, 'close' => true, 'modal' => true, 'roll' => false, 'resize' => false, 'tabWidth' => 120, 'tabStep' => 3, 'blinkToFront' => true, 'tabSpace' => 10), $data);
             $mainPanelScript = 'var ' . $panelName . '={},' . $panelName . 'Tabs=[];' . 'leimnud.event.add(window,"load",function(){' . $panelName . ' = new leimnud.module.panel();' . 'var mycontent=document.getElementById("' . $this->publisherId . '[' . $intPos . ']");' . $panelName . '.options={' . 'size:{w:' . $data['width'] . ',h:' . $data['height'] . '},' . 'position:{x:' . $data['left'] . ',y:' . $data['top'] . '},' . 'title:"' . addcslashes($data['title'], '\\"') . '",' . 'theme:"processmaker",' . 'statusBar:true,' . 'headerBar:true,' . 'control:{' . ' close:' . ($data['close'] ? 'true' : 'false') . ',' . ' roll:' . ($data['roll'] ? 'true' : 'false') . ',' . ' drag:' . ($data['drag'] ? 'true' : 'false') . ',' . ' resize:' . ($data['resize'] ? 'true' : 'false') . '},' . 'fx:{' . ' drag:' . ($data['drag'] ? 'true' : 'false') . ',' . ' modal:' . ($data['modal'] ? 'true' : 'false') . ',' . ' blinkToFront:' . ($data['blinkToFront'] ? 'true' : 'false') . '}' . '};' . $panelName . '.setStyle=' . Bootstrap::json_encode($data['style']) . ';' . $panelName . '.tab={' . 'width:' . ($data['tabWidth'] + $data['tabSpace']) . ',' . 'optWidth:' . $data['tabWidth'] . ',' . 'step :' . $data['tabStep'] . ',' . 'options:[]' . '};';
             print ' ';
             break;
         case 'panel-tab':
             global $tabCount;
             global $mainPanelScript;
             global $panelName;
             $onChange = $Part['Content'];
             $beforeChange = $Part['Data'];
             if (SYS_LANG == 'es') {
                 $mainPanelScript = str_replace("120", "150", $mainPanelScript);
             } else {
                 $mainPanelScript = str_replace("150", "120", $mainPanelScript);
             }
             $mainPanelScript .= $panelName . 'Tabs[' . $tabCount . ']=' . 'document.getElementById("' . $Part['File'] . '");' . $panelName . '.tab.options[' . $panelName . '.tab.options.length]=' . '{' . 'title  :"' . addcslashes($Part['Template'], '\\"') . '",' . 'noClear  :true,' . 'content  :function(){' . ($beforeChange != '' ? 'if (typeof(' . $beforeChange . ')!=="undefined") {' . $beforeChange . '();}' : '') . $panelName . 'Clear();' . $panelName . 'Tabs[' . $tabCount . '].style.display="";' . ($onChange != '' ? 'if (typeof(' . $onChange . ')!=="undefined") {' . $onChange . '();}' : '') . '}.extend(' . $panelName . '),' . 'selected:' . ($tabCount == 0 ? 'true' : 'false') . '};';
             $tabCount++;
             break;
         case 'panel-close':
             global $mainPanelScript;
             global $panelName;
             global $tabCount;
             $mainPanelScript .= $panelName . '.make();';
             $mainPanelScript .= 'for(var r=0;r<' . $tabCount . ';r++)' . 'if (' . $panelName . 'Tabs[r])' . $panelName . '.addContent(' . $panelName . 'Tabs[r]);';
             $mainPanelScript .= '});';
             $mainPanelScript .= 'function ' . $panelName . 'Clear(){';
             $mainPanelScript .= 'for(var r=0;r<' . $tabCount . ';r++)' . 'if (' . $panelName . 'Tabs[r])' . $panelName . 'Tabs[r].style.display="none";}';
             $oHeadPublisher =& headPublisher::getSingleton();
             $oHeadPublisher->addScriptCode($mainPanelScript);
             break;
         case 'blank':
             print ' ';
             break;
         case 'varform':
开发者ID:norahmollo,项目名称:processmaker,代码行数:67,代码来源:class.publisher.php

示例6: streamJSTranslationFile

 /**
  * streaming a big JS file with small js files
  *
  * @author Fernando Ontiveros Lira <fernando@colosa.com>
  * @access public
  * @param string $file
  * @param boolean $download
  * @param string $downloadFileName
  * @return string
  */
 public function streamJSTranslationFile($filename, $locale = 'en')
 {
     $typearray = explode('.', basename($filename));
     $typeCount = count($typearray);
     $typeName = $typeCount > 3 ? $typearray[1] : $typearray[0];
     $typeName = trim($typeName);
     $fileConst = $typeName == 'translation' ? 'translation.' . $locale : 'translation.' . $typeName . '.' . $locale;
     if ($typeName == 'translation') {
         $defaultTranslations = array();
         $foreignTranslations = array();
         $calendarJs = '';
         //load the translations table
         if (is_file(PATH_LANGUAGECONT . 'translation.en')) {
             require_once PATH_LANGUAGECONT . 'translation.en';
             $defaultTranslations = $translation;
         }
         //if some foreign language was requested and its translation file exists
         if ($locale != 'en' && file_exists(PATH_LANGUAGECONT . 'translation.' . $locale)) {
             require_once PATH_LANGUAGECONT . 'translation.' . $locale;
             //load the foreign translations table
             $foreignTranslations = $translation;
         }
         if (defined("SHOW_UNTRANSLATED_AS_TAG") && SHOW_UNTRANSLATED_AS_TAG != 0) {
             $translation = $foreignTranslations;
         } else {
             $translation = array_merge($defaultTranslations, $foreignTranslations);
         }
         $calendarJsFile = PATH_GULLIVER_HOME . "js/widgets/js-calendar/lang/" . $locale . ".js";
         if (!file_exists($calendarJsFile)) {
             $calendarJsFile = PATH_GULLIVER_HOME . "js/widgets/js-calendar/lang/en.js";
         }
         $calendarJs = file_get_contents($calendarJsFile) . "\n";
         return $calendarJs . 'var TRANSLATIONS = ' . Bootstrap::json_encode($translation) . ';';
     } else {
         unset($typearray[0]);
         unset($typearray[count($typearray)]);
         $newName = implode('.', $typearray);
         if (file_exists(PATH_LANGUAGECONT . $newName)) {
             require_once PATH_LANGUAGECONT . $newName;
             $return = '';
             eval('$return = "var TRANSLATIONS_" . strtoupper($typeName) . " = " . Bootstrap::json_encode($translation' . $typeName . ') . ";";');
             return $return;
         }
         return;
     }
 }
开发者ID:norahmollo,项目名称:processmaker,代码行数:56,代码来源:class.bootstrap.php

示例7: saveExtddEvents

 public function saveExtddEvents($oData)
 {
     $oTask = new Task();
     $oEvent = new Event();
     $sEvn_uid = '';
     $aData = array();
     $aData['PRO_UID'] = $oData->uid;
     $aData['EVN_TYPE'] = $oData->evn_type;
     $aData['EVN_POSX'] = $oData->position->x;
     $aData['EVN_POSY'] = $oData->position->y;
     $aData['EVN_STATUS'] = 'ACTIVE';
     $aData['EVN_WHEN'] = '1';
     $aData['EVN_ACTION'] = '';
     if (preg_match("/Inter/", $aData['EVN_TYPE'])) {
         $aData['EVN_RELATED_TO'] = 'MULTIPLE';
     }
     if (preg_match("/Start/", $aData['EVN_TYPE'])) {
         $aData['EVN_RELATED_TO'] = 'MULTIPLE';
     }
     $sEvn_uid = $oData->evn_uid;
     $oEventData = EventPeer::retrieveByPK($sEvn_uid);
     if (is_null($oEventData)) {
         $sEvn_uid = $oEvent->create($aData);
     } else {
         $aData['EVN_UID'] = $sEvn_uid;
         $oEvent->update($aData);
     }
     $oEncode->uid = $sEvn_uid;
     //$oJSON = new Services_JSON();
     return Bootstrap::json_encode($oEncode);
     //$oJSON->encode( $oEncode );
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:32,代码来源:class.processMap.php

示例8: generateFileTranslation

 public function generateFileTranslation($languageId = '')
 {
     $translation = array();
     $translationJS = array();
     if ($languageId === '') {
         $languageId = defined('SYS_LANG') ? SYS_LANG : 'en';
     }
     $c = new Criteria();
     $c->add(TranslationPeer::TRN_LANG, $languageId);
     $c->addAscendingOrderByColumn('TRN_CATEGORY');
     $c->addAscendingOrderByColumn('TRN_ID');
     $tranlations = TranslationPeer::doSelect($c);
     $cacheFile = PATH_LANGUAGECONT . "translation." . $languageId;
     $cacheFileJS = PATH_CORE . 'js' . PATH_SEP . 'labels' . PATH_SEP . $languageId . ".js";
     foreach ($tranlations as $key => $row) {
         if ($row->getTrnCategory() === 'LABEL') {
             $translation[$row->getTrnId()] = $row->getTrnValue();
         }
         if ($row->getTrnCategory() === 'JAVASCRIPT') {
             $translationJS[$row->getTrnId()] = $row->getTrnValue();
         }
     }
     try {
         if (!is_dir(dirname($cacheFile))) {
             G::mk_dir(dirname($cacheFile));
         }
         if (!is_dir(dirname($cacheFileJS))) {
             G::mk_dir(dirname($cacheFileJS));
         }
         $f = fopen($cacheFile, 'w+');
         fwrite($f, "<?php\n");
         fwrite($f, '$translation =' . 'unserialize(\'' . addcslashes(serialize($translation), '\\\'') . "');\n");
         fwrite($f, "?>");
         fclose($f);
         //$json = new Services_JSON(); DEPRECATED
         $f = fopen($cacheFileJS, 'w');
         fwrite($f, "var G_STRINGS =" . Bootstrap::json_encode($translationJS) . ";\n");
         fclose($f);
         $res['cacheFile'] = $cacheFile;
         $res['cacheFileJS'] = $cacheFileJS;
         $res['rows'] = count($translation);
         $res['rowsJS'] = count($translationJS);
         return $res;
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:47,代码来源:Translation.php

示例9: Stage

         } else {
             $bContinue = true;
         }
     }
     $oStage = new Stage();
     $oNewStage = new stdclass();
     $oNewStage->label = G::LoadTranslation('ID_STAGE') . ' ' . $iStageNumber;
     if ($oData->position->x < 0) {
         $oData->position->x *= -1;
     }
     if ($oData->position->y < 0) {
         $oData->position->y *= -1;
     }
     $oNewStage->uid = $oStage->create(array('PRO_UID' => $oData->uid, 'STG_TITLE' => $oNewStage->label, 'STG_POSX' => $oData->position->x, 'STG_POSY' => $oData->position->y, 'STG_INDEX' => $iIndex));
     //$oJSON = new Services_JSON();
     echo Bootstrap::json_encode($oNewStage);
     break;
 case 'saveStagePosition':
     require_once 'classes/model/Stage.php';
     //$oJSON = new Services_JSON();
     $oData = Bootstrap::json_decode(stripslashes($_POST['data']));
     $oStage = new Stage();
     $aFields = $oStage->load($oData->uid);
     $aFields['STG_UID'] = $oData->uid;
     $aFields['STG_POSX'] = $oData->position->x;
     $aFields['STG_POSY'] = $oData->position->y;
     $oStage->update($aFields);
     break;
 case 'deleteStage':
     require_once 'classes/model/Stage.php';
     //$oJSON = new Services_JSON();
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:tracker_Ajax.php

示例10: array

             //
             $count++;
             $aResults[] = array("id" => $id, "value" => htmlspecialchars($value), "info" => htmlspecialchars($info));
         }
     }
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     // Date in the past
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     // always modified
     header("Cache-Control: no-cache, must-revalidate");
     // HTTP/1.1
     header("Pragma: no-cache");
     // HTTP/1.0
     if (isset($_REQUEST['json'])) {
         header("Content-Type: application/json");
         echo Bootstrap::json_encode(array("status" => 0, "results" => $aResults));
     } else {
         header("Content-Type: text/xml");
         echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?><results>";
         for ($i = 0; $i < count($aResults); $i++) {
             echo "<rs id=\"" . $aResults[$i]['id'] . "\" info=\"" . $aResults[$i]['info'] . "\">" . $aResults[$i]['value'] . "</rs>";
         }
         echo "</results>";
     }
 } catch (Exception $e) {
     $err = $e->getMessage();
     //$err = eregi_replace("[\n|\r|\n\r]", ' ', $err);
     $err = preg_replace("[\n|\r|\n\r]", ' ', $err);
     //Made compatible to PHP 5.3
     echo '{"status":1, "message":"' . $err . '"}';
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:genericAjax.php

示例11: generateFileTranslationMafe

    public function generateFileTranslationMafe ()
    {
        $translation = Array ();

        $c = new Criteria();
        $c->add( TranslationPeer::TRN_ID, '%ID_MAFE_%', Criteria::LIKE );
        $c->addAscendingOrderByColumn( 'TRN_CATEGORY' );
        $c->addAscendingOrderByColumn( 'TRN_ID' );
        //$c->addAscendingOrderByColumn( 'TRN_LANG' );
        $tranlations = TranslationPeer::doSelect( $c );

        $mafeFolder = PATH_HTML . "translations";
        $cacheFileMafe = PATH_HTML . "translations" . PATH_SEP. 'translationsMafe' . ".js";

        foreach ($tranlations as $key => $row) {
            if ($row->getTrnCategory() === 'LABEL') {
                $translation[$row->getTrnLang()][$row->getTrnId()] = $row->getTrnValue();
            }
        }

        try {

            G::verifyPath($mafeFolder, true);
            if (! is_dir( dirname( $cacheFileMafe ) )) {
                G::mk_dir( dirname( $cacheFileMafe ) );
            }

            $f = fopen( $cacheFileMafe, 'w' );
            if ($f == false) {
                error_log("Error: Cannot write into cacheFileMafe: $cacheFileMafe\n");
            } else {
                fwrite( $f, "var __TRANSLATIONMAFE = " . Bootstrap::json_encode( $translation ) . ";\n");
                fclose( $f );
            }

            $res['cacheFileMafe'] = $cacheFileMafe;
            $res['languague'] = count($cacheFileMafe);
            $res['rowsMafeJS'] = count( $translation );
            return $res;
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }
开发者ID:rrsc,项目名称:processmaker,代码行数:43,代码来源:Translation.php

示例12: while

                $criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
                $criteria->add(AppDelayPeer::PRO_UID, $oData->pro_uid);
                $criteria->add(AppDelayPeer::APP_TYPE, 'PAUSE');
                $criteria->add(AppDelayPeer::APP_DISABLE_ACTION_DATE, null, Criteria::ISNULL);
                $dataset = AppDelayPeer::doSelectRS($criteria);
                if ($dataset->getRecordCount() > 0) {
                    $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                    $dataset->next();
                    while ($row = $dataset->getRow()) {
                        $criteria = new Criteria('workflow');
                        $criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
                        $criteria->add(AppDelegationPeer::APP_UID, $row['APP_UID']);
                        $criteria->add(AppDelegationPeer::DEL_INDEX, $row['APP_DEL_INDEX']);
                        $criteria->add(AppDelegationPeer::TAS_UID, $oData->task_uid);
                        $casesNumRec += AppDelegationPeer::doCount($criteria);
                        $dataset->next();
                    }
                }
            }
            $response = new stdclass();
            $response->casesNumRec = $casesNumRec;
            //$json = new Services_JSON();
            $sOutput = Bootstrap::json_encode($response);
            break;
    }
    if (isset($sOutput)) {
        die($sOutput);
    }
} catch (Exception $oException) {
    die($oException->getMessage() . "\n" . $oException->getTraceAsString());
}
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:processes_Ajax.php

示例13: Users

     $dataset->next();
 }
 $aFields = $RBAC->getAuthSource($_POST['sUID']);
 //G::LoadThirdParty( 'pear/json', 'class.json' );
 //$oJSON = new Services_JSON();
 $i = 0;
 $oUser = new Users();
 $aAux = $RBAC->searchUsers($_POST['sUID'], $_POST['sKeyword']);
 $aUsers = array();
 // note added by gustavo cruz gustavo-at-colosa.com
 // changed the user data showed to accept FirstName and LastName variables
 $aUsers[] = array('Checkbox' => 'char', 'Username' => 'char', 'FullName' => 'char', 'FirstName' => 'char', 'LastName' => 'char', 'Email' => 'char', 'DistinguishedName' => 'char');
 foreach ($aAux as $aUser) {
     if (!in_array($aUser['sUsername'], $pmUsers)) {
         // add replace to change D'Souza to D*Souza by krlos
         $sCheckbox = '<div align="center"><input type="checkbox" name="aUsers[' . $i . ']" id="aUsers[' . $i . ']" value=\'' . str_replace("\\'", "*", addslashes(Bootstrap::json_encode($aUser))) . '\' /></div>';
         $i++;
     } else {
         $sCheckbox = G::LoadTranslation('ID_USER_REGISTERED') . ':<br />(' . $aUser['sUsername'] . ')';
     }
     // note added by gustavo cruz gustavo-at-colosa.com
     // assign the user data to the DBArray variable.
     $aUsers[] = array('Checkbox' => $sCheckbox, 'Username' => $aUser['sUsername'], 'FullName' => $aUser['sFullname'], 'FirstName' => $aUser['sFirstname'], 'LastName' => $aUser['sLastname'], 'Email' => $aUser['sEmail'], 'DistinguishedName' => $aUser['sDN']);
 }
 global $_DBArray;
 $_DBArray['users'] = $aUsers;
 $_SESSION['_DBArray'] = $_DBArray;
 G::LoadClass('ArrayPeer');
 $oCriteria = new Criteria('dbarray');
 $oCriteria->setDBArrayTable('users');
 $aData = array('Checkbox' => '0', 'FullName' => '0');
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:authSources_Ajax.php

示例14: streamJSTranslationFile

 /**
  * streaming a big JS file with small js files
  *
  * @author Fernando Ontiveros Lira <fernando@colosa.com>
  * @access public
  * @param string $file
  * @param boolean $download
  * @param string $downloadFileName
  * @return string
  */
 public function streamJSTranslationFile($filename, $locale = 'en')
 {
     $defaultTranslations = array();
     $foreignTranslations = array();
     //if the default translations table doesn't exist we can't proceed
     if (!is_file(PATH_LANGUAGECONT . 'translation.en')) {
         return;
     }
     //load the translations table
     require_once PATH_LANGUAGECONT . 'translation.en';
     $defaultTranslations = $translation;
     //if some foreign language was requested and its translation file exists
     if ($locale != 'en' && file_exists(PATH_LANGUAGECONT . 'translation.' . $locale)) {
         require_once PATH_LANGUAGECONT . 'translation.' . $locale;
         //load the foreign translations table
         $foreignTranslations = $translation;
     }
     if (defined("SHOW_UNTRANSLATED_AS_TAG") && SHOW_UNTRANSLATED_AS_TAG != 0) {
         $translation = $foreignTranslations;
     } else {
         $translation = array_merge($defaultTranslations, $foreignTranslations);
     }
     $calendarJs = '';
     $calendarJsFile = PATH_GULLIVER_HOME . "js/widgets/js-calendar/lang/" . $locale . ".js";
     if (!file_exists($calendarJsFile)) {
         $calendarJsFile = PATH_GULLIVER_HOME . "js/widgets/js-calendar/lang/en.js";
     }
     $calendarJs = file_get_contents($calendarJsFile) . "\n";
     return $calendarJs . 'var TRANSLATIONS = ' . Bootstrap::json_encode($translation) . ';';
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:40,代码来源:class.bootstrap.php

示例15: array

     $aData = array();
     $aData['condition'] = 'neyek';
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_ConditionalShowHide', '', $aRow);
     G::RenderPage('publish', 'raw');
     //echo '<script>+alert(getField("FCD_CONDITION").value)</script>';
     break;
 case 'getDynaFieds':
     G::LoadThirdParty('pear/json', 'class.json');
     G::LoadSystem('dynaformhandler');
     $_DYN_FILENAME = $_SESSION['Current_Dynafom']['Parameters']['FILE'];
     $sFilter = isset($_POST['filter']) ? $_POST['filter'] : '';
     //$oJSON = new Services_JSON();
     $oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . $_DYN_FILENAME . '.xml');
     $aFilter = explode(',', $sFilter);
     $aAvailableFields = $oDynaformHandler->getFieldNames($aFilter);
     print Bootstrap::json_encode($aAvailableFields);
     break;
 case 'showDynavars':
     G::LoadSystem('dynaformhandler');
     $_DYN_FILENAME = $_SESSION['Current_Dynafom']['Parameters']['FILE'];
     $sFilter = isset($_POST['filter']) ? $_POST['filter'] : '';
     $oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . $_DYN_FILENAME . '.xml');
     $aFilter = explode(',', $sFilter);
     $aAvailableFields = $oDynaformHandler->getFieldNames($aFilter);
     $aFieldNames = array('id' => 'char', 'name' => 'char');
     $aRows = array();
     foreach ($aAvailableFields as $sFieldname) {
         array_push($aRows, array('id' => $sFieldname, 'name' => $sFieldname));
     }
     $rows = array_merge(array($aFieldNames), $aRows);
     global $_DBArray;
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:conditionalShowHide_Ajax.php


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