Exemplo n.º 1
0
function main_default($eventData)
{
    global $wuiMainFrame, $innomaticLocale, $wuiTitleBar;
    $wuiGrid = new WuiGrid('grid', array('rows' => '3', 'cols' => '2'));
    $wuiGrid->addChild(new WuiLabel('oldpasswordlabel', array('label' => $innomaticLocale->getStr('rootpasswordold_label'))), 0, 0);
    $wuiGrid->addChild(new WuiString('oldpassword', array('disp' => 'action', 'password' => 'true')), 0, 1);
    $wuiGrid->addChild(new WuiLabel('newpasswordalabel', array('label' => $innomaticLocale->getStr('rootpassworda_label'))), 1, 0);
    $wuiGrid->addChild(new WuiString('newpassworda', array('disp' => 'action', 'password' => 'true')), 1, 1);
    $wuiGrid->addChild(new WuiLabel('newpasswordblabel', array('label' => $innomaticLocale->getStr('rootpasswordb_label'))), 2, 0);
    $wuiGrid->addChild(new WuiString('newpasswordb', array('disp' => 'action', 'password' => 'true')), 2, 1);
    $wuiVGroup = new WuiVertgroup('vertgroup', array('align' => 'center'));
    $wuiVGroup->addChild($wuiGrid);
    $wuiVGroup->addChild(new WuiSubmit('submit', array('caption' => $innomaticLocale->getStr('rootpasschange_submit'))));
    $formEventsCall = new WuiEventsCall();
    $formEventsCall->addEvent(new WuiEvent('view', 'default', ''));
    $formEventsCall->addEvent(new WuiEvent('action', 'edit', ''));
    $wuiForm = new WuiForm('form', array('action' => $formEventsCall->getEventsCallString()));
    $wuiForm->addChild($wuiVGroup);
    $wuiMainFrame->addChild($wuiForm);
}
Exemplo n.º 2
0
 public static function buildEventsCallString($eventsCallUrl, $eventsArray)
 {
     $tmp_action = new WuiEventsCall($eventsCallUrl);
     if (is_array($eventsArray)) {
         while (list(, $event) = each($eventsArray)) {
             $tmp_action->addEvent(new WuiEvent($event[0], $event[1], isset($event[2]) ? $event[2] : ''));
         }
     }
     return $tmp_action->getEventsCallString();
 }
Exemplo n.º 3
0
 protected function generateSource()
 {
     if ($this->mrWuiDisp->getEventName() == 'treemenu-' . $this->mName) {
         $disp_data = $this->mrWuiDisp->getEventData();
         if (isset($disp_data['activegroup'])) {
             $this->mActiveGroup = $disp_data['activegroup'];
             $this->StoreSession(array('activegroup' => $this->mActiveGroup));
         }
     }
     if (is_array($this->mElements)) {
         $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' treemenu -->' : '') . "<table border=\"0\"" . (strlen($this->mWidth) ? " width=\"" . $this->mWidth . "\"" : "") . ">\n";
         reset($this->mElements);
         while (list($key, $val) = each($this->mElements)) {
             // Set default group
             //
             if (!$this->mActiveGroup) {
                 $this->mActiveGroup = $key;
             }
             if ($this->mAllGroupsActive == "true" or $key == $this->mActiveGroup) {
                 $this->mLayout .= "<tr><td align=\"center\" class=\"boldbig\"><center>" . "           <table width=\"100%\" border=\"0\" bgcolor=\"" . $this->mThemeHandler->mColorsSet['buttons']['selected'] . "\" cellspacing=\"0\" cellpadding=\"3\">\n                        <tr>\n                        <td><img src=\"" . $this->mThemeHandler->mStyle['arrowright'] . "\"></td>\n                        <td valign=\"middle\" align=\"center\" width=\"100%\" class=\"boldbig\"><center>" . $val["groupname"] . "</center></td>\n                        </tr>\n                        </table>" . '</center></td></tr>';
                 if (isset($val['groupelements']) and is_array($val['groupelements'])) {
                     while (list($keyitem, $valitem) = each($val['groupelements'])) {
                         $target = '';
                         if (isset($valitem['target']) and strlen($valitem['target'])) {
                             $target = $valitem['target'];
                         } else {
                             if (strlen($this->mTarget)) {
                                 $target = $this->mTarget;
                             }
                         }
                         //if ( !isset($val['themesized'] ) )
                         $this->mLayout .= '<tr><td align="center" class="normal" ' . 'style="cursor: pointer;" ' . " onMouseOver=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['buttons']['notselected'] . "'\" " . " onMouseOut=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['pages']['bgcolor'] . "'\" " . ' onClick="this.style.backgroundColor=\'' . $this->mThemeHandler->mColorsSet['pages']['bgcolor'] . '\';' . (((strlen($target) and $target != '_blank') ? ($target == '_top' ? '' : 'parent.') . $target . '.' : '') . ($target == '_blank' ? 'window.open(\'' : 'location.href=\'') . $valitem['action'] . ($target == '_blank' ? '\')' : '\'')) . '"><center><img src="' . $valitem['image'] . '" border="0"' . ((isset($valitem['themesized']) and $valitem['themesized'] != 'false') ? ' style="width: 32px; height: 32px;"' : '') . '><br><font color="' . $this->mThemeHandler->mColorsSet['buttons']['text'] . '">' . $valitem['name'] . '</font></center></td></tr>';
                     }
                 }
             } else {
                 $events_call = new WuiEventsCall();
                 $events_call->addEvent(new WuiEvent("wui", "treemenu-" . $this->mName, array("activegroup" => $key)));
                 reset($this->mDispEvents);
                 while (list(, $event) = each($this->mDispEvents)) {
                     $events_call->addEvent($event);
                 }
                 $this->mLayout .= '<tr><td align="center" class="boldbig"><center>' . '           <table width="100%" style="cursor: pointer;" ' . " onMouseOver=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['buttons']['selected'] . "'\" " . " onMouseOut=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['buttons']['notselected'] . "'\" " . ' onClick="this.style.backgroundColor=\'' . $this->mThemeHandler->mColorsSet['buttons']['selected'] . '\';' . 'location.href=\'' . $events_call->getEventsCallString() . '\'" ' . "border=\"0\" bgcolor=\"" . $this->mThemeHandler->mColorsSet['buttons']['notselected'] . "\" cellspacing=\"0\" cellpadding=\"3\">\n                        <tr>\n                        <td><img src=\"" . $this->mThemeHandler->mStyle['arrowdown'] . "\" border=\"0\"></td>\n                        <td valign=\"middle\" align=\"center\" width=\"100%\" class=\"boldbig\"><center>" . '<font color="' . $this->mThemeHandler->mColorsSet['buttons']['text'] . '">' . $val['groupname'] . '</font>' . '</center></td>
                     </tr>
                     </table>' . '</center></td></tr>';
                 unset($events_call);
             }
         }
         $this->mLayout .= "</table>\n" . ($this->mComments ? "<!-- end " . $this->mName . " treemenu -->" : "");
     }
     return true;
 }
    public function viewEditrole($eventData)
    {
        $role = new \Innomatic\Domain\User\Role((int) $eventData['id']);
        $formEventsCall = new WuiEventsCall();
        $formEventsCall->addEvent(new WuiEvent('action', 'editrole', array('id' => $eventData['id'])));
        $formEventsCall->addEvent(new WuiEvent('view', 'roles', ''));
        $xml = '<vertgroup><children>
            <form><name>roledata</name>
              <args>
                <action>' . WuiXml::cdata($formEventsCall->getEventsCallString()) . '</action>
              </args>
              <children>
              <vertgroup><children>
                <vertgroup><children>
                <grid>
                  <children>
                    <label row="0" col="0"><args><label>' . WuiXml::cdata($this->localeCatalog->getStr('rolename_label')) . '</label></args></label>
                    <string row="0" col="1"><name>name</name><args><disp>action</disp><value>' . WuiXml::cdata($role->getName()) . '</value><size>25</size></args></string>
                    <label row="1" col="0"><args><label>' . WuiXml::cdata($this->localeCatalog->getStr('roledescription_label')) . '</label></args></label>
                    <text row="1" col="1"><name>description</name><args><disp>action</disp><value>' . WuiXml::cdata($role->getDescription()) . '</value><rows>5</rows><cols>40</cols></args></text>

                  </children>
                </grid>
                </children></vertgroup>

                </children></vertgroup>
                <horizbar />

                <horizgroup><children>
                  <button><name>save</name>
	                <args>
                      <themeimage>buttonok</themeimage>
                      <label>' . WuiXml::cdata($this->localeCatalog->getStr('saverole_button')) . '</label>
                      <action>' . WuiXml::cdata($formEventsCall->getEventsCallString()) . '</action>
                      <formsubmit>roledata</formsubmit>
                      <horiz>true</horiz>
                      <frame>false</frame>
                    </args>
                  </button>
                </children></horizgroup>
              </children>
            </form>
            </children></vertgroup>';
        $this->wuiMainframe->addChild(new WuiXml('user', array('definition' => $xml)));
        $this->wuiTitlebar->mTitle .= ' - ' . $userData['username'] . ' - ' . $this->localeCatalog->getStr('edituser_title');
    }
 public function viewlanguage($eventData)
 {
     $actionDispatcher = new WuiDispatcher('action');
     $locCountry = new LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getCountry());
     $countryLanguage = $locCountry->Language();
     $languageLocale = new LocaleCatalog('innomatic::localization', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
     $selectedLanguage = $actionDispatcher->getEventData();
     if (isset($selectedLanguage['language'])) {
         $selectedLanguage = $selectedLanguage['language'];
     }
     $wuiVGroup = new WuiVertgroup('vgroup');
     $languageQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM locale_languages');
     while (!$languageQuery->eof) {
         $languages[$languageQuery->getFields('langshort')] = $languageLocale->getStr($languageQuery->getFields('langname'));
         $languageQuery->moveNext();
     }
     $wuiLocaleGrid = new WuiGrid('localegrid', array('rows' => '1', 'cols' => '3'));
     $wuiLocaleGrid->addChild(new WuiLabel('languagelabel', array('label' => $this->localeCatalog->getStr('language_label'))), 0, 0);
     $wuiLocaleGrid->addChild(new WuiComboBox('language', array('disp' => 'action', 'elements' => $languages, 'default' => $selectedLanguage ? $selectedLanguage : \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage())), 0, 1);
     $wuiLocaleGrid->addChild(new WuiSubmit('submit1', array('caption' => $this->localeCatalog->getStr('language_submit'))), 0, 2);
     $wuiVGroup->addChild($wuiLocaleGrid);
     $wuiVGroup->addChild(new WuiHorizBar('horizbar1'));
     $wuiVGroup->addChild(new WuiLabel('deflanglabel', array('label' => sprintf($this->localeCatalog->getStr('countrylanguage_label'), $languages[$countryLanguage]))));
     $formEventsCall = new WuiEventsCall();
     $formEventsCall->addEvent(new WuiEvent('action', 'setlanguage', ''));
     $formEventsCall->addEvent(new WuiEvent('view', 'language', ''));
     $wuiForm = new WuiForm('languageform', array('action' => $formEventsCall->getEventsCallString()));
     $wuiForm->addChild($wuiVGroup);
     $this->wuiMainframe->addChild($wuiForm);
     $this->wuiTitlebar->mArgs['title'] .= ' - ' . $this->localeCatalog->getStr('language_title');
 }