view release on metacpan or search on metacpan
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js view on Meta::CPAN
// Replace headers with <strong>
if (getParam(ed, "paste_convert_headers_to_strong")) {
process([
[/<h[1-6][^>]*>/gi, "<p><strong>"],
[/<\/h[1-6][^>]*>/gi, "</strong></p>"]
]);
}
// Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
// Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
stripClass = getParam(ed, "paste_strip_class_attributes");
if (stripClass !== "none") {
function removeClasses(match, g1) {
if (stripClass === "all")
return '';
var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
function(v) {
return (/^(?!mso)/i.test(v));
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/tiny_mce.js view on Meta::CPAN
(function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3.8",releaseDate:"2010-06-30",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE...
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js view on Meta::CPAN
hex_colors : s.force_hex_style_colors,
class_filter : s.class_filter,
update_styles : 1,
fix_ie_paragraphs : 1,
valid_styles : s.valid_styles
});
t.schema = new tinymce.dom.Schema();
t.serializer = new tinymce.dom.Serializer(extend(s, {
valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,
dom : t.dom,
schema : t.schema
}));
t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);
t.formatter = new tinymce.Formatter(this);
// Register default formats
t.formatter.register({
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js view on Meta::CPAN
if (s.preformatted) {
t.onPostProcess.add(function(ed, o) {
o.content = o.content.replace(/^\s*<pre.*?>/, '');
o.content = o.content.replace(/<\/pre>\s*$/, '');
if (o.set)
o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';
});
}
if (s.verify_css_classes) {
t.serializer.attribValueFilter = function(n, v) {
var s, cl;
if (n == 'class') {
// Build regexp for classes
if (!t.classesRE) {
cl = t.dom.getClasses();
if (cl.length > 0) {
s = '';
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
sub _max_order {
my $hashref = shift;
my $order = 0;
foreach my $k (keys %{$hashref}) {
$order = $k if ($k > $order);
}
return $order;
}
sub verify_x12 {
my $s = shift;
my $vendor = shift;
my $dataref = shift;
# all we do here right now is make sure our header envelope matches who we think
# is sending to use, and who they thing they are sending to....
my %check = (
partner_edi_identifier => 'ISA08',
partner_edi_qualifier => 'ISA07',
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
}
} else {
if ($s->{in}{orderby}) {
$s->{in}{orderby} =~ s/[^a-z_]//g;
}
$s->{orderby} = $s->{in}{orderby} || $args{$k};
}
}
}
sub verify_date {
=head2 verify_date
my $truefalse = $s->verify_date($date,$mindays,$maxdays);
Make sure a date is in a given range of days from today.
=cut
my $s = shift;
my $date = shift;
my $mindays = shift;
my $maxdays = shift;
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
my $ok = $s->db_q("
SELECT CASE WHEN date(?) BETWEEN date(now() + interval '$mindays day')
AND date(now() + interval '$maxdays day') THEN TRUE ELSE FALSE END
",'scalar',
v => [ $date ]);
return $ok;
}
sub verify_zipcode {
=head2 verify_zipcode
my $truefalse = $s->verify_zipcode(\$zip,[\$state],[\$city],[\$country]);
Check the zipcode database for the given zipcode. If optional references
are included in call and zipcode is valid, these scalar references are
populated with the database information.
=cut
my $s = shift;
my $ref = shift;
my $state = shift;
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
if ($$ref eq '' && $c{country}) {
return 1;
} else {
return 0;
}
} else {
return 0;
}
}
sub verify_email {
=head2 verify_email
my $truefalse = $s->verify_email($email);
=cut
my $s = shift;
my $ref = shift;
$$ref =~ s/^\s+//;
$$ref =~ s/\s+$//;
$$ref = lc $$ref;
if ($$ref =~ /^[\.a-zA-Z&0-9_-]*\@(.*\.[a-zA-Z]*)$/) {
return 1;
} else {
return 0;
}
}
sub verify_regex {
=head2 verify_regex
my $truefalse = $s->verify_regex($regex);
=cut
my $s = shift;
my $regex = shift;
eval {
my $reg = qr/^$regex$/;
};
if ($@) {
return 0;
} else {
return 1;
}
}
sub verify_phone {
=head2 verify_phone
my $truefalse = $s->verify_phone(\$number,[\$other]);
Checks that $number is only numbers and it 10 digits. Changes
input scalar reference to clean it up. If $other scalar reference
is provided, and nothing is in $number, then function returns true
which is somewhat of a bypass for non 10 digit phone verification.
=cut
my $s = shift;
my $ref = shift;
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
next if ($ref->{noedit} && $s->{in}{$s->{o}{id}} =~ m/^\d+$/);
# if a boolean field is NOT NULL, then make sure it's set to false
# otherwise the database will blow a cork below on the update statement
if ($ref->{boolean} && $ref->{notnull} && !defined($s->{in}{$ref->{k}})) {
$s->{in}{$ref->{k}} = 0;
}
$hash{$kname} = $s->{in}{$kname};
if ($ref->{verify} eq "zipcode" && $hash{$kname}) {
unless($s->verify_zipcode(\$hash{$kname},\$state,\$city)) {
croak "$hash{$kname} is not a valid zipcode";
}
}
if ($ref->{verify} eq 'regex' && $hash{$kname}) {
unless($s->verify_regex($hash{$kname})) {
croak "$hash{$kname} is not a valid regular expression";
}
}
if ($ref->{verify} eq "phone" && $hash{$kname}) {
unless($s->verify_phone(\$hash{$kname})) {
croak "$hash{$kname} is not a valid phone number";
}
}
if ($ref->{verify} eq "email" && $hash{$kname}) {
unless($s->verify_email(\$hash{$kname})) {
croak "$hash{$kname} is not a valid email";
}
}
}
$hash{city} = $city if (defined($hash{city}) && $city);
$hash{state} = $state if (defined($hash{state}) && $state);
$s->{dbh}->begin_work;
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
foreach my $n (keys %fmap) {
$import{$fmap{$n}} = $r[$i][$n-1];
}
# clean up....
foreach my $k (keys %import) {
$import{$k} =~ s/(\s+|,)$//; # strip trailing spaces and other crap like commas
$import{$k} =~ s/^\s+//; # strip leading
}
# verify....
foreach my $f (@{$s->{o}{fields}}) {
if ($import{$f->{k}} && $f->{verify}) {
if ($f->{verify} eq 'phone') {
unless($s->verify_phone(\$import{$f->{k}})) {
$import{$f->{k}} = '';
}
} elsif ($f->{verify} eq 'email') {
unless($s->verify_email(\$import{$f->{k}})) {
$import{$f->{k}} = '';
}
} elsif ($f->{verify} eq 'zipcode') {
unless($s->verify_zipcode(\$import{$f->{k}},\$import{state},\$import{city})) {
$import{$f->{k}} = '';
$import{state} = '';
$import{city} = '';
}
}
}
}
# override values from the file it they were defined
# in the default values area
lib/Apache/SdnFw/lib/Core.pm view on Meta::CPAN
# now, from this list, lets make a data structure we can use
foreach my $ref (@list) {
$s->{employee}{object}{$ref->{a_object}}{$ref->{a_function}} = 1;
}
}
sub _authenticate {
my $s = shift;
if ($s->{in}{forgot_email}) {
if ($s->verify_email(\$s->{in}{forgot_email})) {
my %employee = $s->db_q("
SELECT *
FROM employees
WHERE email=?
",'hash',
v => [ $s->{in}{forgot_email} ]);
if ($employee{employee_id}) {
my $new = int(rand(1)*100000);
$s->db_q("
lib/Apache/SdnFw/template/object/me.pm view on Meta::CPAN
SELECT *
FROM employees_v
WHERE employee_id=?
",'hash',
v => [ $s->{employee_id} ]);
my %update;
foreach my $k (qw(email)) {
if ($s->{in}{$k}) {
unless($s->verify_email(\$s->{in}{$k})) {
croak "$s->{in}{$k} is not a valid email";
}
}
$update{$k} = $s->{in}{$k};
}
foreach my $k (qw(login name)) {
$update{$k} = $s->{in}{$k};
}
lib/Apache/SdnFw/tt/display.tt view on Meta::CPAN
<td>[% hash.${s.o.id} %]</td>
</tr>
[% FOREACH f IN s.o.fields -%]
<tr>
<th>[% f.t %]</th>
<td>[% IF f.r && f.i %]
<a href="[% s.ubase %]/[% f.r %]/display?[% f.i %]=[% hash.${f.i} %]">[% hash.${f.k} %]</a>
[% ELSIF f.textarea %]
<pre>[% hash.${f.k} %]</pre>
[% ELSE %]
[% IF f.verify == 'phone' %][% s.format_phone(hash.${f.k}) %]
[% ELSIF f.boolean %]
[% s.format_boolean(hash.${f.k}) %]
[% ELSIF f.textarea %]
[% s.format_text(hash.${f.k}) %]
[% ELSIF f.format == 'percent' %]
[% s.format_percent(hash.${f.k}) %]
[% ELSE %][% hash.${f.k} %][% END %]
[% END %]</td>
</tr>
[% END -%]
lib/Apache/SdnFw/tt/display.tt.xml view on Meta::CPAN
<[% s.object %]>
<[% s.o.id %]>[% hash.${s.o.id} %]</[% s.o.id %]>
[% FOREACH f IN s.o.fields -%]
<[% f.k %]>[% IF f.r && f.i %]
<[% f.i %]>[% hash.${f.i} %]</[% f.i %]>
<name>[% s.escape(hash.${f.k}) %]</name>[% ELSE %]
[% IF f.verify == 'phone' %][% s.format_phone(hash.${f.k}) %]
[% ELSIF f.boolean %]
[% s.format_boolean(hash.${f.k}) %]
[% ELSIF f.format == 'percent' %]
[% s.format_percent(hash.${f.k}) %]
[% ELSE %][% s.escape(hash.${f.k}) %][% END %]
[% END %]</[% f.k %]>
[% END %]
<relations>
[% FOREACH r IN s.o.relations %]
<[% r.t %]>
lib/Apache/SdnFw/tt/edit.tt view on Meta::CPAN
[% s.html_textarea(f.k,hash.${f.k},40,10) %]
[% ELSIF f.v %]
[% IF f.notnull %]
[% s.html_select_basic(f.v,f.k,hash.${f.k}) %]
[% ELSE %]
[% s.html_select_basic(f.v,f.k,hash.${f.k},1) %]
[% END %]
[% ELSIF f.calendar %]
[% s.html_input_calendar(f.k,hash.${f.k}) %]
[% ELSE %]
[% IF f.verify == 'phone' %]
[% s.html_input(f.k,s.format_phone(hash.${f.k}),f.input_size) %]
[% ELSE %]
[% s.html_input(f.k,hash.${f.k},f.input_size) %]
[% END %]
[% END %]
</td>
</tr>
</tbody>
[% END -%]
</table>
lib/Apache/SdnFw/tt/list.tt view on Meta::CPAN
[% END -%]
[% END -%]
</tr>
</thead>
<tbody>
[% FOREACH l IN list -%]
<tr>
<td><a href="[% s.ubase %]/[% s.object %]/display?[% s.o.id %]=[% l.${s.o.id} %]">[% l.${s.o.id} %]</a></td>
[% FOREACH f IN s.o.fields -%]
[% UNLESS f.hidelist %]
<td>[% IF f.verify == 'phone' %][% s.format_phone(l.${f.k}) %][% ELSIF f.boolean %][% s.format_boolean(l.${f.k}) %][% ELSE %][% l.${f.k} %][% END %]</td>
[% END %]
[% END -%]
</tr>
[% END -%]
</tbody>
</table>
</div>