function SlideOrderedRepeatableComponentCollection()
 {
     parent::WOrderedRepeatableComponentCollection();
     $this->_addButton->setLabel(_("Add a Text-Slide"));
     $this->_addFromBasketButton = WEventButton::withLabel(dgettext("polyphony", "Create Slides from Selection"));
     $this->_addFromBasketButton->setParent($this);
 }
Ejemplo n.º 2
0
 /**
  * Function will return display message of exception if its set by the calle.
  * if it is not set then we are generating some default display messages based
  * on mapi error code.
  * @return string returns error-message that should be sent to client to display.
  */
 public function getDisplayMessage()
 {
     if (!empty($this->displayMessage)) {
         return $this->displayMessage;
     }
     switch ($this->getCode()) {
         case MAPI_E_NO_ACCESS:
             return dgettext("zarafa", "You have insufficient privileges to open this object.");
         case MAPI_E_LOGON_FAILED:
         case MAPI_E_UNCONFIGURED:
             return dgettext("zarafa", "Logon Failed. Please check your name/password.");
         case MAPI_E_NETWORK_ERROR:
             return dgettext("zarafa", "Can not connect to Zarafa server.");
         case MAPI_E_UNKNOWN_ENTRYID:
             return dgettext("zarafa", "Can not open object with provided id.");
         case MAPI_E_NO_RECIPIENTS:
             return dgettext("zarafa", "There are no recipients in the message.");
         case MAPI_E_NOT_FOUND:
             return dgettext("zarafa", "Can not find object.");
         case MAPI_E_NOT_ENOUGH_MEMORY:
             return dgettext("zarafa", "Operation failed: Server does not have enough memory.");
         case MAPI_E_INTERFACE_NOT_SUPPORTED:
         case MAPI_E_INVALID_PARAMETER:
         case MAPI_E_INVALID_ENTRYID:
         case MAPI_E_INVALID_OBJECT:
         case MAPI_E_TOO_COMPLEX:
         case MAPI_E_CORRUPT_DATA:
         case MAPI_E_END_OF_SESSION:
         case MAPI_E_AMBIGUOUS_RECIP:
         case MAPI_E_COLLISION:
         case MAPI_E_UNCONFIGURED:
         default:
             return sprintf(dgettext("zarafa", "Unknown MAPI Error: %s"), get_mapi_error_name($this->getCode()));
     }
 }
 /**
  * Return the heading text for this action, or an empty string.
  * 
  * @return string
  * @access public
  * @since 4/26/05
  */
 function getHeadingText()
 {
     $harmoni = Harmoni::instance();
     $idManager = Services::getService("Id");
     $agentManager = Services::getService("Agent");
     // Get the id of the selected agent using $_REQUEST
     $harmoni->request->startNamespace("polyphony-authorizations");
     $mult = RequestContext::value("mult");
     $agents = RequestContext::value("agents");
     $idObject = $mult ? null : $idManager->getId(RequestContext::value("agentId"));
     //		$idObject =$idManager->getId(RequestContext::value("agentId"));
     $GLOBALS["agentId"] = $idObject;
     $harmoni->request->endNamespace();
     if ($mult) {
         return dgettext("polyphony", "Modify Authorizations for Multiple Agents");
     } else {
         if ($agentManager->isGroup($idObject)) {
             $agent = $agentManager->getGroup($idObject);
             return dgettext("polyphony", "Modify Authorizations for Group") . ": <em> " . $agent->getDisplayName() . "</em>";
         } else {
             if ($agentManager->isAgent($idObject)) {
                 $agent = $agentManager->getAgent($idObject);
                 return dgettext("polyphony", "Modify Authorizations for User") . ": <em> " . $agent->getDisplayName() . "</em>";
             } else {
                 return dgettext("polyphony", "Modify Authorizations for the User/Group Id") . ": <em> " . $idObject->getIdString() . "</em>";
             }
         }
     }
 }
Ejemplo n.º 4
0
function ewatcher_translate($string)
{
    $ewatcher_domain = "messages";
    bindtextdomain($ewatcher_domain, "Modules/ewatcher/locale");
    bind_textdomain_codeset($ewatcher_domain, "UTF-8");
    return dgettext($ewatcher_domain, $string);
}
 /**
  * Constructor
  * 
  * @return object
  * @access public
  * @since 10/20/05
  */
 function WVerifiedChangeInput()
 {
     $this->_checkbox = new WCheckBox();
     $this->_checkbox->setParent($this);
     $this->_label = dgettext("polyphony", "Apply to All");
     $this->setChecked(true);
 }
Ejemplo n.º 6
0
    public function getView()
    {
        $text = dgettext('users', 'Sign in');
        return <<<EOF
<a id = "sign-in" data-toggle = "modal" href = "#user-login-modal"><i class = "fa fa-user"></i> {$text}</a>
<div id="user-signin">
    <div class = "modal fade" id="user-login-modal" tabindex = "-1" role = "dialog" aria-labelledby = "userLoginModalLabel" aria-hidden = "true">
        <div id="user-login-dialog" class = "modal-dialog" style="max-width:50%; min-width:25%;">
            <div class = "modal-content">
                <div class = "modal-body">
                    <form method = "post" action = "index.php">
                        <input type = "hidden" name = "module" value = "users" />
                        <input type = "hidden" name = "action" value = "user" />
                        <input type = "hidden" name = "command" value = "login" />
                        <div class = "form-group">
                            <input type = "text" id = "phpws-username" name = "phpws_username" placeholder = "Username" class = "form-control" />
                        </div>
                        <div class = "form-group">
                            <input type = "password" name = "phpws_password" placeholder = "Password" class = "form-control" />
                        </div>
                        <input type = "submit" class = "btn btn-primary" value = "Sign in" />
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
EOF;
    }
Ejemplo n.º 7
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function users_register($module, &$content)
{
    PHPWS_Core::initModClass('users', 'Permission.php');
    PHPWS_Core::initModClass('users', 'My_Page.php');
    $no_permissions = $no_my_page = FALSE;
    $result = Users_Permission::createPermissions($module);
    if (is_null($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'Permissions file not implemented.'));
        $content[] = dgettext('users', 'Permissions file not implemented.');
        $no_permissions = TRUE;
    } elseif (PHPWS_Error::isError($result)) {
        $content[] = dgettext('users', 'Permissions table not created successfully.');
        PHPWS_Error::log($result);
        return FALSE;
    } else {
        $content[] = dgettext('users', 'Permissions table created successfully.');
    }
    $result = My_Page::registerMyPage($module);
    if (PHPWS_Error::isError($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'A problem occurred when trying to register this module to My Page.'));
        $content[] = dgettext('users', 'A problem occurred when trying to register this module to My Page.');
        return FALSE;
    } elseif ($result != FALSE) {
        $content[] = dgettext('users', 'My Page registered to Users module.');
    } else {
        $no_my_page = TRUE;
    }
    // If the module doesn't have permissions or a My Page
    // then don't register the module
    if ($no_permissions && $no_my_page) {
        return FALSE;
    } else {
        return TRUE;
    }
}
Ejemplo n.º 8
0
 public static function registerPermissions($module, &$content)
 {
     $tableName = Users_Permission::getPermissionTableName($module);
     if (!PHPWS_DB::isTable($tableName)) {
         return Users_Permission::createPermissions($module);
     }
     $file = sprintf('%smod/%s/boost/permission.php', PHPWS_SOURCE_DIR, $module);
     if (!is_file($file)) {
         return NULL;
     }
     include_once $file;
     if (!isset($permissions) || !is_array($permissions)) {
         return TRUE;
     }
     $db = new PHPWS_DB($tableName);
     $columns = $db->getTableColumns();
     $columnSetting = 'smallint NOT NULL default \'0\'';
     foreach ($permissions as $perm_name => $perm_proper) {
         if (in_array($perm_name, $columns)) {
             continue;
         }
         $result = $db->addTableColumn($perm_name, $columnSetting);
         if (PHPWS_Error::isError($result)) {
             $content[] = sprintf(dgettext('users', 'Could not create "%s" permission column.'), $perm_name);
             PHPWS_Error::log($result);
         } else {
             $content[] = sprintf(dgettext('users', '"%s" permission column created.'), $perm_name);
         }
     }
     return TRUE;
 }
Ejemplo n.º 9
0
function _t($string, $domain = '')
{
    if ($domain == '' && defined('newLocale')) {
        $domain = newLocale;
    }
    return dgettext($domain, $string);
}
Ejemplo n.º 10
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function filecabinet_install(&$content)
{
    $home_dir = PHPWS_Boost::getHomeDir();
    $mm_dir = $home_dir . 'files/multimedia/';
    if (!is_dir($mm_dir)) {
        if (!@mkdir($mm_dir)) {
            $content[] = dgettext('filecabinet', 'Failed to create files/multimedia directory.');
            return false;
        } else {
            $content[] = dgettext('filecabinet', 'files/multimedia directory created successfully.');
        }
    }
    $files_dir = $home_dir . 'files/filecabinet/';
    if (!is_dir($files_dir)) {
        if (!@mkdir($files_dir)) {
            $content[] = dgettext('filecabinet', 'Failed to create files/filecabinet/ directory.');
            return false;
        } else {
            $content[] = dgettext('filecabinet', 'files/filecabinet/ directory created successfully.');
        }
    }
    $classify_dir = $home_dir . 'files/filecabinet/incoming/';
    if (!is_dir($classify_dir)) {
        if (!@mkdir($classify_dir)) {
            $content[] = dgettext('filecabinet', 'Failed to create files/filecabinet/incoming directory.');
            return false;
        } else {
            $content[] = dgettext('filecabinet', 'files/filecabinet/incoming directory created successfully.');
        }
    }
    return true;
}
Ejemplo n.º 11
0
 /**
  * alias for dgettext
  * if domain not specify, use $_GET['module'] instead
  **/
 function _T($var, $domain = null)
 {
     if ($domain == null && !empty($_GET['module'])) {
         $domain = $_GET['module'];
     }
     return dgettext($domain, $var);
 }
 /**
  * Tells the wizard component to update itself - this may include getting
  * form post data or validation - whatever this particular component wants to
  * do every pageload. 
  * @param string $fieldName The field name to use when outputting form data or
  * similar parameters/information.
  * @access public
  * @return boolean - TRUE if everything is OK
  */
 function update($fieldName)
 {
     $val = RequestContext::value($fieldName);
     if ($val !== null && (!$this->_startingDisplay || $val != $this->_startingDisplay)) {
         $string = HtmlString::fromString($val);
         $string->cleanXSS();
         $this->_value = $string->asString();
         if (trim($this->_value) != trim($val)) {
             $this->_origErrorText = $this->getErrorText();
             $this->setErrorText(dgettext('polyphony', "The value you entered has been reformatted to meet XHTML validity standards."));
             // Add both error text if validation failed as well.
             if (!$this->validate()) {
                 $this->setErrorText($this->getErrorText() . " " . $this->_origErrorText);
             }
             $this->_showError = true;
             // Add a dummy rule if needed.
             if (!$this->getErrorRule()) {
                 $this->setErrorRule(new WECRegex('.*'));
             }
         } else {
             // Reset the original error text.
             if (isset($this->_origErrorText)) {
                 $this->setErrorText($this->_origErrorText);
             }
         }
     }
     return $this->validate();
 }
Ejemplo n.º 13
0
 public function getLocalList()
 {
     $self = $this;
     return array_map(function ($name) use($self) {
         return dgettext($self->getDatabase()->getIso(), $name);
     }, $this->_list);
 }
 function WRepeatableComponentCollection()
 {
     $this->_addLabel = dgettext("polyphony", "Add");
     $this->_removeLabel = dgettext("polyphony", "Remove");
     $this->_addButton = WEventButton::withLabel($this->_addLabel);
     $this->_addButton->setParent($this);
 }
Ejemplo n.º 15
0
 private function translate($countryName)
 {
     if ($this->doNotTranslate) {
         return $countryName;
     }
     return dgettext(self::DOMAIN, $countryName);
 }
Ejemplo n.º 16
0
/**
 * Uninstall file for PhatForm v2
 *
 * Rewritten to work with phpwebsite 1.0
 * @version $Id$
 */
function phatform_uninstall(&$content)
{
    $db = new PHPWS_DB('mod_phatform_forms');
    $db->addColumn('id');
    $db->addColumn('archiveTableName');
    $db->addWhere('saved', 1);
    $result = $db->select();
    if (!empty($result)) {
        foreach ($result as $form) {
            if (empty($form['archiveTableName'])) {
                $table = 'mod_phatform_form_' . $form['id'];
                if (PHPWS_DB::isTable($table)) {
                    PHPWS_DB::dropTable($table);
                }
            } else {
                $table = $form['archiveTableName'];
                PHPWS_DB::dropTable($table);
            }
        }
        $content[] = dgettext('phatform', 'Removed all dynamic Form Generator tables.');
    }
    PHPWS_DB::dropTable('mod_phatform_forms');
    PHPWS_DB::dropTable('mod_phatform_options');
    PHPWS_DB::dropTable('mod_phatform_textfield');
    PHPWS_DB::dropTable('mod_phatform_textarea');
    PHPWS_DB::dropTable('mod_phatform_dropbox');
    PHPWS_DB::dropTable('mod_phatform_multiselect');
    PHPWS_DB::dropTable('mod_phatform_radiobutton');
    PHPWS_DB::dropTable('mod_phatform_checkbox');
    $content[] = dgettext('phatform', 'All Form Generator static tables removed.');
    return TRUE;
}
Ejemplo n.º 17
0
 public static function _($text)
 {
     if (!function_exists("bindtextdomain")) {
         return $text;
     }
     if (trim($text) == "" or trim($text) == "&nbsp;") {
         return $text;
     }
     #echo self::$currentDomain.":".$text."<br />";
     if (self::$generate and self::$domainPaths[self::$currentDomain] != null and Session::getLanguage() != "de_DE") {
         if (!isset(self::$poFileContent[self::$currentDomain])) {
             self::$poFileContent[self::$currentDomain] = file_get_contents(self::$domainPaths[self::$currentDomain] . "/" . Session::getLanguage() . "/LC_MESSAGES/messages" . self::$currentDomain . ".po");
         }
         #var_dump(self::$poFileContent);
         $putText = str_replace("\"", "\\\"", $text);
         if (strpos($putText, "\n") !== false) {
             $putText = str_replace("\n", "\\n\"\n\"", $putText);
             $putText = "\"\n\"{$putText}";
         }
         if (strpos(self::$poFileContent[self::$currentDomain], "msgid \"{$putText}\"") === false) {
             file_put_contents(self::$domainPaths[self::$currentDomain] . "/" . Session::getLanguage() . "/LC_MESSAGES/messages" . self::$currentDomain . ".po", "msgid \"{$putText}\"\nmsgstr \"\"\n\n", FILE_APPEND);
             self::$poFileContent[self::$currentDomain] = file_get_contents(self::$domainPaths[self::$currentDomain] . "/" . Session::getLanguage() . "/LC_MESSAGES/messages" . self::$currentDomain . ".po");
         }
     }
     $text = dgettext("messages" . self::$currentDomain, $text);
     $args = func_get_args();
     if (count($args) > 1) {
         for ($i = count($args); $i > 1; $i--) {
             $text = str_replace("%" . ($i - 1), $args[$i - 1], $text);
         }
     }
     $text = Aspect::joinPoint("translate", null, __METHOD__, $text, $text);
     return $text;
 }
Ejemplo n.º 18
0
/**
 * Uninstall file for block
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function block_uninstall(&$content)
{
    PHPWS_DB::dropTable('block');
    PHPWS_DB::dropTable('block_pinned');
    $content[] = dgettext('block', 'Block tables removed.');
    return true;
}
Ejemplo n.º 19
0
/**
 * Uninstall file for access
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function access_uninstall(&$content)
{
    PHPWS_DB::dropTable('access_shortcuts');
    PHPWS_DB::dropTable('access_allow_deny');
    $content[] = dgettext('access', 'Access tables removed.');
    return TRUE;
}
Ejemplo n.º 20
0
 /**
  * @param string $message1
  * @param string|null $message2
  * @param int|null $n
  * @return string
  */
 public function getText($message1, $message2 = null, $n = null)
 {
     if (!isset($message2)) {
         return dgettext($this->domain, $message1);
     } else {
         return dngettext($this->domain, $message1, $message2, $n);
     }
 }
Ejemplo n.º 21
0
 public function get($key, $component = null)
 {
     if (is_null($component)) {
         return gettext($key);
     } else {
         return dgettext($component, $key);
     }
 }
Ejemplo n.º 22
0
function check_session()
{
    if (!isset($_SESSION['PHAT_FormManager']->form)) {
        $info = sprintf('<p style="text-align : center; margin: 50% auto">%s</p>', dgettext('phatform', 'Session timeout'), dgettext('phatform', 'We are sorry, but your session timed out. You will need to click the Back button on your browser to return to the previous page.'));
        echo Layout::wrap($info);
        exit;
    }
}
Ejemplo n.º 23
0
/**
 * Wiki for phpWebSite
 *
 * See docs/CREDITS for copyright information
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @package Wiki
 * @author Greg Meiste <*****@*****.**>
 */
function wiki_uninstall(&$content)
{
    PHPWS_DB::dropTable('wiki_pages');
    PHPWS_DB::dropTable('wiki_images');
    PHPWS_DB::dropTable('wiki_interwiki');
    $content[] = dgettext('wiki', 'Wiki tables removed.');
    return TRUE;
}
Ejemplo n.º 24
0
 /**
  * Handler around _() gettext function
  *
  * @param string $string no transalted string
  * @return string $string transalted string
  */
 function __($string, $domain = null)
 {
     if (!empty($domain)) {
         return dgettext($domain, $string);
     } else {
         return _($string);
     }
 }
Ejemplo n.º 25
0
 public function getLogoutLink()
 {
     if ($this->logout_link) {
         return sprintf('<a href="%s"><span class="fa fa-sign-out"></span> %s</a>', $this->logout_link, dgettext('users', 'Log Out'));
     } else {
         return null;
     }
 }
Ejemplo n.º 26
0
 public function getSubLink($text, $parentVars)
 {
     $regularLink = PHPWS_Text::moduleLink(dgettext('hms', $text), 'hms', $parentVars);
     $nakedDisplayCmd = CommandFactory::getCommand('SelectResidenceHall');
     $nakedDisplayCmd->setTitle('Hall Overview');
     $nakedDisplayCmd->setOnSelectCmd(CommandFactory::getCommand('HallOverviewNakedDisplay'));
     return $regularLink . ' [' . $nakedDisplayCmd->getLink('Printable') . ']';
 }
Ejemplo n.º 27
0
 public function getTitle($noBreak = true)
 {
     if ($noBreak) {
         return str_replace(' ', '&nbsp;', dgettext($this->itemname, $this->title));
     } else {
         return dgettext($this->itemname, $this->title);
     }
 }
Ejemplo n.º 28
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function signup_uninstall(&$content)
{
    PHPWS_DB::dropTable('signup_sheet');
    PHPWS_DB::dropTable('signup_peeps');
    PHPWS_DB::dropTable('signup_slots');
    $content[] = dgettext('signup', 'Signup tables dropped.');
    return true;
}
Ejemplo n.º 29
0
/**
 * Busca un mensaje único traducido en el dominio 'nml'.
 * El mensaje puede contener cadenas de formato.
 *
 * @param string      $message Mensaje con formato que se va a buscar.
 * @param array|mixed $args    Un objeto, una lista de objetos o múltiples
 *   argumentos que se van a incluir en las cadenas de formato del mensaje.
 *
 * @return string
 * @see    dgettext
 * */
function msg($message, $args = null)
{
    $translated = dgettext(GETTEXT_DOMAIN, $message);
    if (func_num_args() > 2) {
        $args = array_slice(func_get_args(), 1);
    }
    return String::format($translated, $args);
}
Ejemplo n.º 30
0
 /**
  * Translates a string in the current domain, or the domain
  * provided as the second argument.
  *
  * @param string $string
  * @param string $textDomain
  * @return string
  */
 public function t($string, $textDomain = null)
 {
     if (empty($textDomain)) {
         return gettext($string);
     } else {
         return dgettext($textDomain, $string);
     }
 }