Esempio n. 1
0
 function credit_selection()
 {
     $selection_string = '';
     $close_string = '';
     $credit_class_string = '';
     if (MODULE_ORDER_TOTAL_INSTALLED) {
         $header_string .= '<div class="infobox_heading">' . Translate('Hebt u een cadeaubon?') . '</div>';
         $header_string .= '<div class="infobox_content">';
         $close_string = '</div>';
         reset($this->modules);
         $output_string = '';
         while (list(, $value) = each($this->modules)) {
             $class = substr($value, 0, strrpos($value, '.'));
             if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {
                 if ($selection_string == '') {
                     $selection_string = $GLOBALS[$class]->credit_selection();
                 }
                 if ($use_credit_string != '' || $selection_string != '') {
                     $output_string = $selection_string;
                 }
             }
         }
         if ($output_string != '') {
             $output_string = $header_string . $output_string;
             $output_string .= $close_string;
         }
     }
     return $output_string;
 }
Esempio n. 2
0
 public function Index($Offset = 0, $Limit = NULL)
 {
     $this->AddJsFile('/js/library/jquery.gardenmorepager.js');
     $this->AddJsFile('search.js');
     $this->Title(Translate('Search'));
     if (!is_numeric($Limit)) {
         $Limit = Gdn::Config('Garden.Search.PerPage', 20);
     }
     $Search = $this->Form->GetFormValue('Search');
     $ResultSet = $this->SearchModel->Search($Search, $Offset, $Limit);
     $this->SetData('SearchResults', $ResultSet, TRUE);
     $this->SetData('SearchTerm', Format::Text($Search), TRUE);
     $NumResults = $ResultSet->NumRows();
     if ($NumResults == $Offset + $Limit) {
         $NumResults++;
     }
     // Build a pager
     $PagerFactory = new PagerFactory();
     $Pager = $PagerFactory->GetPager('MorePager', $this);
     $Pager->MoreCode = 'More Results';
     $Pager->LessCode = 'Previous Results';
     $Pager->ClientID = 'Pager';
     $Pager->Configure($Offset, $Limit, $NumResults, 'garden/search/%1$s/%2$s/?Search=' . Format::Url($Search));
     $this->SetData('Pager', $Pager, TRUE);
     $this->View = 'results';
     $this->Render();
 }
 public function Advanced()
 {
     $this->Permission('Vanilla.Settings.Manage');
     $Validation = new Gdn_Validation();
     $ConfigurationModel = new Gdn_ConfigurationModel($Validation);
     $ConfigurationModel->SetField(array('Vanilla.Archive.Date', 'Vanilla.Archive.Exclude'));
     // Set the model on the form.
     $this->Form->SetModel($ConfigurationModel);
     // If seeing the form for the first time...
     if ($this->Form->AuthenticatedPostBack() === FALSE) {
         // Apply the config settings to the form.
         $this->Form->SetData($ConfigurationModel->Data);
     } else {
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Archive.Date', 'Date');
         // Grab old config values to check for an update.
         $ArchiveDateBak = Gdn::Config('Vanilla.Archive.Date');
         $ArchiveExcludeBak = (bool) Gdn::Config('Vanilla.Archive.Exclude');
         $Saved = $this->Form->Save();
         if ($Saved) {
             $ArchiveDate = Gdn::Config('Vanilla.Archive.Date');
             $ArchiveExclude = (bool) Gdn::Config('Vanilla.Archive.Exclude');
             if ($ArchiveExclude != $ArchiveExcludeBak || $ArchiveExclude && $ArchiveDate != $ArchiveDateBak) {
                 $DiscussionModel = new Gdn_DiscussionModel();
                 $DiscussionModel->UpdateDiscussionCount('All');
             }
             $this->StatusMessage = Translate("Your changes have been saved.");
         }
     }
     $this->AddSideMenu('vanilla/settings/advanced');
     $this->AddJsFile('settings.js');
     $this->Title(Translate('Advanced Forum Settings'));
     $this->Render();
 }
Esempio n. 4
0
 public function Spam()
 {
     $this->Permission('Vanilla.Spam.Manage');
     $this->AddSideMenu('vanilla/settings/spam');
     $Validation = new Gdn_Validation();
     $ConfigurationModel = new Gdn_ConfigurationModel('Configuration', PATH_CONF . DS . 'config.php', $Validation);
     $ConfigurationModel->SetField(array('Vanilla.Discussion.SpamCount', 'Vanilla.Discussion.SpamTime', 'Vanilla.Discussion.SpamLock', 'Vanilla.Comment.SpamCount', 'Vanilla.Comment.SpamTime', 'Vanilla.Comment.SpamLock', 'Vanilla.Comment.MaxLength'));
     // Set the model on the form.
     $this->Form->SetModel($ConfigurationModel);
     // If seeing the form for the first time...
     if ($this->Form->AuthenticatedPostBack() === FALSE) {
         // Apply the config settings to the form.
         $this->Form->SetData($ConfigurationModel->Data);
     } else {
         // Define some validation rules for the fields being saved
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamCount', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamCount', 'Integer');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamTime', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamTime', 'Integer');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamLock', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Discussion.SpamLock', 'Integer');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamCount', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamCount', 'Integer');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamTime', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamTime', 'Integer');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamLock', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.SpamLock', 'Integer');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.MaxLength', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Vanilla.Comment.MaxLength', 'Integer');
         if ($this->Form->Save() !== FALSE) {
             $this->StatusMessage = Translate("Your changes have been saved.");
         }
     }
     $this->Render();
 }
Esempio n. 5
0
 public function PluginController_SingleSignOn_Create($Sender, $EventArguments)
 {
     $Sender->Head->Title('Single Sign-on');
     $Sender->AddSideMenu('garden/plugin/singlesignon');
     $Validation = new Gdn_Validation();
     $ConfigurationModel = new Gdn_ConfigurationModel($Validation);
     $ConfigurationModel->SetField(array('Garden.Authenticator.Type', 'Garden.Authenticator.Encoding', 'Garden.Authenticator.AuthenticateUrl', 'Garden.Authenticator.SignInUrl', 'Garden.Authenticator.SignOutUrl', 'Garden.Authenticator.RegisterUrl', 'Garden.Cookie.Path'));
     // Set the model on the form.
     $Sender->Form = new Gdn_Form();
     $Sender->Form->SetModel($ConfigurationModel);
     // If seeing the form for the first time...
     if ($Sender->Form->AuthenticatedPostBack() === FALSE) {
         // Apply the config settings to the form.
         $Sender->Form->SetData($ConfigurationModel->Data);
         $Sender->Form->SetValue('EnableSSO', Gdn::Config('Garden.Authenticator.Type') == 'Handshake' ? 'TRUE' : '');
     } else {
         // Make sure to force some values
         $Sender->Form->SetFormValue('Garden.Authenticator.Type', $Sender->Form->GetFormValue('EnableSSO', '') == 'TRUE' ? 'Handshake' : 'Password');
         $Sender->Form->SetFormValue('Garden.Authenticator.Encoding', 'ini');
         $Sender->Form->SetFormValue('Garden.Cookie.Path', '/');
         // <-- Make sure that Vanilla's cookies don't have a path
         if ($Sender->Form->Save() !== FALSE) {
             $Sender->StatusMessage = Translate("Your changes have been saved successfully.");
         }
     }
     $Sender->Render(PATH_PLUGINS . DS . 'SingleSignOn' . DS . 'views' . DS . 'index.php');
 }
Esempio n. 6
0
 function quote($method = '')
 {
     global $order, $cart, $shipping_weight, $shipping_num_boxes;
     if (MODULE_SHIPPING_TABLE4_MODE == 'price') {
         $order_total = $cart->show_total();
     } else {
         $order_total = $shipping_weight;
     }
     $table4_cost = preg_split("/[:,]/", MODULE_SHIPPING_TABLE4_COST);
     $size = sizeof($table4_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($order_total <= $table4_cost[$i]) {
             $shipping = $table4_cost[$i + 1];
             break;
         }
     }
     if (MODULE_SHIPPING_TABLE4_MODE == 'weight') {
         $shipping = $shipping * $shipping_num_boxes;
     }
     $this->quotes = array('id' => $this->code, 'module' => Translate('table4 titel'), 'methods' => array(array('id' => $this->code, 'title' => Translate('table4 omschrijving'), 'cost' => $shipping + MODULE_SHIPPING_TABLE4_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Esempio n. 7
0
 function create_iDeal_box()
 {
     if ($this->query_bankinfo) {
         $client = new SoapClient($this->wsdl);
         $params->merchantID = MODULE_PAYMENT_ICEPAY_MERCHANT_ID;
         $params->secretCode = MODULE_PAYMENT_ICEPAY_SECRET;
         $ideal_object = $client->GetIDEALIssuers($params);
         $ideal_issuers = $ideal_object->GetIDEALIssuersResult->string;
         $ideal_issuers_arr = array();
         foreach ($ideal_issuers as $ideal_issuer) {
             $ideal_issuers_arr[] = array('id' => $ideal_issuer, 'text' => $ideal_issuer);
         }
     } else {
         $ideal_issuers_arr[] = array('id' => 'ABNAMRO', 'text' => 'ABN AMRO');
         $ideal_issuers_arr[] = array('id' => 'ASNBANK', 'text' => 'ASN Bank');
         $ideal_issuers_arr[] = array('id' => 'FRIESLAND', 'text' => 'Friesland Bank');
         $ideal_issuers_arr[] = array('id' => 'ING', 'text' => 'ING');
         $ideal_issuers_arr[] = array('id' => 'RABOBANK', 'text' => 'Rabobank');
         $ideal_issuers_arr[] = array('id' => 'SNSBANK', 'text' => 'SNS Bank');
         $ideal_issuers_arr[] = array('id' => 'SNSREGIOBANK', 'text' => 'SNS Regio Bank');
         $ideal_issuers_arr[] = array('id' => 'TRIODOSBANK', 'text' => 'Triodos Bank');
         $ideal_issuers_arr[] = array('id' => 'VANLANSCHOT', 'text' => 'Van Lanschot');
     }
     $dropdown = '<select name="ic_issuer" >';
     foreach ($ideal_issuers_arr as $ideal_issuer) {
         $dropdown .= '<option value="' . $ideal_issuer['id'] . '" >' . $ideal_issuer['text'] . '</option>';
     }
     $dropdown .= '</select>';
     $create_iDeal_box = "<div style=\"margin-right:20px; display:block; float:left;\">" . Translate('Kies uw bank voor het afrekenen met iDEAL: ') . $dropdown . "</div>";
     return $create_iDeal_box;
 }
Esempio n. 8
0
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen via automatische incasso');
             break;
     }
 }
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen via Bancontact/Mister Cash');
             break;
     }
 }
Esempio n. 10
0
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen via overboeking');
             break;
     }
 }
Esempio n. 11
0
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betaling via SMS');
             break;
     }
 }
Esempio n. 12
0
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen via de telefoon');
             break;
     }
 }
function TranslateArray($arr)
{
    $retarr = array();
    for ($i = 0; $i < count($arr); $i++) {
        array_push($retarr, Translate($arr[$i], 'en_to_hi'));
    }
    return $retarr;
}
Esempio n. 14
0
 function t($text, $context = '')
 {
     if ($context == '') {
         return Translate($text, __CLASS__);
     } else {
         return Translate_With_GetText_Context($text, $context, __CLASS__);
     }
 }
Esempio n. 15
0
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen via Paypal');
             break;
     }
 }
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen met Mastercard');
             break;
     }
 }
Esempio n. 17
0
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen met American Express');
             break;
     }
 }
Esempio n. 18
0
 public function t($text, $context = Null)
 {
     # Translates the string $text with context $context
     if (empty($context)) {
         return Translate($text, __CLASS__);
     } else {
         return Translate_With_GetText_Context($text, $context, __CLASS__);
     }
 }
Esempio n. 19
0
 function index()
 {
     //$this->load->library('translator');
     $string = '';
     if (isset($_POST['text']) && !empty($_POST['text'])) {
         $string = Translate($_POST['text']);
     }
     echo $string;
 }
Esempio n. 20
0
 function ot_subtotal()
 {
     $this->code = 'ot_subtotal';
     $this->title = Translate('Subtotaal');
     $this->description = MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION;
     $this->enabled = MODULE_ORDER_TOTAL_SUBTOTAL_STATUS == 'true' ? true : false;
     $this->sort_order = MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER;
     $this->output = array();
 }
Esempio n. 21
0
 function ccerr()
 {
     global $order;
     $this->code = 'ccerr';
     $this->title = Translate('Credit Class Error');
     $this->description = Translate('Credit Class Error, needed with Gift Voucher');
     $this->sort_order = MODULE_PAYMENT_CCERR_SORT_ORDER;
     $this->enabled = false;
 }
 function getLangStr($str)
 {
     switch ($str) {
         case "title":
             return Translate('Betalen met paysafecard');
             break;
         case "descr":
             return Translate('The main ICEPAY module must be installed (does not have to be active) to use this payment method.');
             break;
     }
 }
Esempio n. 23
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => Translate('flat5 titel'), 'methods' => array(array('id' => $this->code, 'title' => Translate('flat5 omschrijving'), 'cost' => MODULE_SHIPPING_FLAT5_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Esempio n. 24
0
 static function t($text, $context = Null)
 {
     # Load text domain
     if (!self::$textdomain_loaded) {
         self::loadTextDomain();
     }
     # Translates the string $text with context $context
     if (empty($context)) {
         return Translate($text, self::$textdomain);
     } else {
         return Translate_With_GetText_Context($text, $context, self::$textdomain);
     }
 }
Esempio n. 25
0
 function create_eBanking_box()
 {
     if (MODULE_PAYMENT_ICEPAY_EBANKING_COUNTRY == "USER") {
         $dropdown = '<select name="ic_country" id="setCOUNTRY">';
         foreach ($this->allowedCountriesEBankStrict() as $val) {
             $dropdown .= '<option value="' . $val . '" >' . $this->getCountryName($val) . '</option>';
         }
         $dropdown .= '</select>';
         $langStr = Translate('Kies het land van Direct E-Banking account: ');
         $create_eBanking_box = "<div style=\"margin-right:20px; display:block; float:left;\">" . $this->generateIcon() . $langStr . $dropdown . "</div><br />";
     }
     return $create_eBanking_box;
 }
Esempio n. 26
0
    function Triangle($sides = [], $nodes = [], $colors = [])
    {
        $width = 400;
        $height = 250;
        $paddingX = 50;
        $paddingY = 50;
        $svg = '<div class="img-question text-center">
					<svg width="' . $width . '" height="' . $height . '">';
        $Ax = $paddingX;
        $Ay = $height - $paddingY;
        $Bx = $width - $paddingX;
        $By = $height - $paddingY;
        list($Cx, $Cy) = Triangle($Ax, $Ay, $Bx, $By, 35, 55);
        $svg .= DrawLine($Ax, $Ay, $Bx, $By);
        $svg .= DrawLine($Ax, $Ay, $Cx, $Cy);
        $svg .= DrawLine($Cx, $Cy, $Bx, $By);
        $svg .= DrawText($Ax, $Ay + 25, '$A$', 15);
        $svg .= DrawText($Bx, $By + 25, '$B$', 15);
        $svg .= DrawText($Cx, $Cy - 10, '$C$', 15);
        $svg .= DrawText($Ax + 40, $Ay - 7, '$\\alpha$', 15);
        $svg .= DrawText($Bx - 30, $By - 10, '$\\beta$', 15);
        $svg .= DrawArc($Ax, $Ay, $Bx, $By, $Cx, $Cy, 65);
        $svg .= DrawArc($Bx, $By, $Cx, $Cy, $Ax, $Ay, 55);
        list($P1x, $P1y) = LinePoint($Cx, $Cy, $Ax, $Ay, 25);
        list($P2x, $P2y) = LinePoint($Cx, $Cy, $Bx, $By, 25);
        list($P3x, $P3y) = Translate($P1x, $P1y, 25, $Cx, $Cy, $Bx, $By);
        $svg .= DrawLine($P1x, $P1y, $P3x, $P3y);
        $svg .= DrawLine($P2x, $P2y, $P3x, $P3y);
        foreach ($sides as $key => $side) {
            switch ($side) {
                case 'AC':
                case 'CA':
                    $svg .= DrawLine($Ax, $Ay, $Cx, $Cy, $colors[$key], 2);
                    $svg .= DrawText(($Ax + $Cx) / 2 - 20, ($Ay + $Cy) / 2, '$\\textcolor{' . $colors[$key] . '}{' . $nodes[$key] . '}$', 15);
                    break;
                case 'AB':
                case 'BA':
                    $svg .= DrawLine($Ax, $Ay, $Bx, $By, $colors[$key], 2);
                    $svg .= DrawText(($Ax + $Bx) / 2, ($Ay + $By) / 2 + 25, '$\\textcolor{' . $colors[$key] . '}{' . $nodes[$key] . '}$', 15);
                    break;
                case 'BC':
                case 'CB':
                    $svg .= DrawLine($Bx, $By, $Cx, $Cy, $colors[$key], 2);
                    $svg .= DrawText(($Bx + $Cx) / 2 + 20, ($By + $Cy) / 2, '$\\textcolor{' . $colors[$key] . '}{' . $nodes[$key] . '}$', 15);
                    break;
            }
        }
        $svg .= '</svg></div>';
        return $svg;
    }
Esempio n. 27
0
 function cod()
 {
     global $order;
     $this->code = 'cod';
     $this->title = Translate('Contante betaling bij afhaling/levering');
     $this->description = Translate('Contante betaling bij afhaling/levering');
     $this->sort_order = MODULE_PAYMENT_COD_SORT_ORDER;
     $this->enabled = MODULE_PAYMENT_COD_STATUS == 'True' ? true : false;
     if ((int) MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
         $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
     }
     if (is_object($order)) {
         $this->update_status();
     }
 }
Esempio n. 28
0
/**
 * Read the translation string from the given index (read form the selected language in Core).
 * The translations strings are located either in /lang/xx.php or within the plugin lang directory.
 * 
 * Example:
 *  {'General_Unknown'|translate} will be translated as 'Unknown' (see the entry in /lang/en.php)
 * 
 * @return string The translated string
 */
function smarty_modifier_translate($stringToken)
{
    if (func_num_args() <= 1) {
        $aValues = array();
    } else {
        $aValues = func_get_args();
        array_shift($aValues);
    }
    try {
        $stringTranslated = Translate($stringToken, $aValues);
    } catch (Exception $e) {
        $stringTranslated = $stringToken;
    }
    return $stringTranslated;
}
Esempio n. 29
0
 public function Index()
 {
     $this->AddJsFile('activity.js');
     $this->Title(Translate('Recent Activity'));
     $Session = Gdn::Session();
     $this->ActivityData = $this->ActivityModel->Get();
     if ($this->ActivityData->NumRows() > 0) {
         $ActivityData = $this->ActivityData->ResultArray();
         $ActivityIDs = ConsolidateArrayValuesByKey($ActivityData, 'ActivityID');
         $this->CommentData = $this->ActivityModel->GetComments($ActivityIDs);
     } else {
         $this->CommentData = FALSE;
     }
     $this->View = 'all';
     $this->Render();
 }
Esempio n. 30
0
 public function Edit($RouteIndex = FALSE)
 {
     $this->Permission('Garden.Routes.Manage');
     $this->AddSideMenu('garden/routes');
     $Routes = Gdn::Config('Routes');
     $this->Route = FALSE;
     if (is_numeric($RouteIndex) && $RouteIndex !== FALSE) {
         $Keys = array_keys($Routes);
         $this->Route = ArrayValue($RouteIndex, $Keys);
     }
     $Validation = new Gdn_Validation();
     $ConfigurationModel = new Gdn_ConfigurationModel('Configuration', PATH_CONF . DS . 'config.php', $Validation);
     $ConfigurationModel->SetField(array('Route', 'Target'));
     // Set the model on the form.
     $this->Form->SetModel($ConfigurationModel);
     // If seeing the form for the first time...
     if (!$this->Form->AuthenticatedPostBack()) {
         // Apply the config settings to the form.
         if ($this->Route !== FALSE) {
             $this->Form->SetData(array('Route' => $this->Route, 'Target' => $Routes[$this->Route]));
         }
     } else {
         // Define some validation rules for the fields being saved
         $ConfigurationModel->Validation->ApplyRule('Route', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Target', 'Required');
         // Validate & Save
         $FormPostValues = $this->Form->FormValues();
         if (in_array($this->Route, $this->ReservedRoutes)) {
             $FormPostValues['Route'] = $this->Route;
         }
         if ($ConfigurationModel->Validate($FormPostValues)) {
             $Config = Gdn::Factory(Gdn::AliasConfig);
             $Path = PATH_CONF . DS . 'config.php';
             $Config->Load($Path, 'Save');
             $Config->Set('Routes' . '.' . ArrayValue('Route', $FormPostValues), ArrayValue('Target', $FormPostValues));
             $Config->Save($Path);
             $this->StatusMessage = Translate("The route was saved successfully.");
             if ($this->_DeliveryType == DELIVERY_TYPE_ALL) {
                 $this->RedirectUrl = Url('garden/routes');
             }
         } else {
             $this->Form->SetValidationResults($ConfigurationModel->ValidationResults());
         }
     }
     $this->Render();
 }