ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
30 participants
755 discussions
Start a n
N
ew thread
[hyperion] 39093: Implement full dependencies for rbuild: changing a header file will now automatically rebuild all modules that include it, directly or indirectly. Very slow, but an irreplaceable tool for header fixing Full dependencies can be enabled by setting ROS_RBUILDFLAGS=-df Whether initially enabled or not, once makefile.auto is generated, full dependencies can be enabled or disabled by setting ROS_BUILDDEPS=full or ROS_BUILDDEPS=auto In case you missed it, full dependencies are VERY SL
by hyperion@svn.reactos.org
Author: hyperion Date: Sun Jan 25 10:19:45 2009 New Revision: 39093 URL:
http://svn.reactos.org/svn/reactos?rev=39093&view=rev
Log: Implement full dependencies for rbuild: changing a header file will now automatically rebuild all modules that include it, directly or indirectly. Very slow, but an irreplaceable tool for header fixing Full dependencies can be enabled by setting ROS_RBUILDFLAGS=-df Whether initially enabled or not, once makefile.auto is generated, full dependencies can be enabled or disabled by setting ROS_BUILDDEPS=full or ROS_BUILDDEPS=auto In case you missed it, full dependencies are VERY SLOW Modified: trunk/reactos/Makefile trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp trunk/reactos/tools/rbuild/configuration.cpp trunk/reactos/tools/rbuild/rbuild.cpp trunk/reactos/tools/rbuild/rbuild.h Modified: trunk/reactos/Makefile URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/Makefile?rev=39093&r1=3909…
============================================================================== --- trunk/reactos/Makefile [iso-8859-1] (original) +++ trunk/reactos/Makefile [iso-8859-1] Sun Jan 25 10:19:45 2009 @@ -117,6 +117,8 @@ # -v Be verbose. # -c Clean as you go. Delete generated files as soon as they are not needed anymore. # -dd Disable automatic dependencies. +# -da Enable automatic dependencies. +# -df Enable full dependencies. # -dm{module} Check only automatic dependencies for this module. # -hd Disable precompiled headers. # -mi Let make handle creation of install directories. Rbuild will not generate the directories. @@ -244,6 +246,7 @@ ECHO_GENDIB =@echo $(QUOTE)[GENDIB] $@$(QUOTE) ECHO_STRIP =@echo $(QUOTE)[STRIP] $@$(QUOTE) ECHO_RGENSTAT=@echo $(QUOTE)[RGENSTAT] $@$(QUOTE) + ECHO_DEPENDS =@echo $(QUOTE)[DEPENDS] $<$(QUOTE) else ECHO_CP = ECHO_MKDIR = @@ -278,6 +281,7 @@ ECHO_GENDIB = ECHO_STRIP = ECHO_RGENSTAT= + ECHO_DEPENDS = endif # Set host compiler/linker Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Sun Jan 25 10:19:45 2009 @@ -313,7 +313,7 @@ void MingwBackend::CheckAutomaticDependenciesForModuleOnly () { - if ( configuration.AutomaticDependencies ) + if ( configuration.Dependencies == AutomaticDependencies ) { Module* module = ProjectNode.LocateModule ( configuration.CheckDependenciesForModuleOnlyModule ); if ( module == NULL ) @@ -519,6 +519,15 @@ void MingwBackend::GenerateGlobalVariables () const { + if ( configuration.Dependencies == FullDependencies ) + { + fprintf ( fMakefile, + "ifeq ($(ROS_BUILDDEPS),)\n" + "ROS_BUILDDEPS:=%s\n" + "endif\n", + "full" ); + } + fprintf ( fMakefile, "PREFIX := %s\n", compilerPrefix.c_str () ); @@ -715,7 +724,7 @@ void MingwBackend::CheckAutomaticDependencies () { - if ( configuration.AutomaticDependencies ) + if ( configuration.Dependencies == AutomaticDependencies ) { printf ( "Checking automatic dependencies..." ); AutomaticDependency automaticDependency ( ProjectNode ); Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Sun Jan 25 10:19:45 2009 @@ -1059,10 +1059,17 @@ "\t${host_ar} -rc $@ $($(module_name)_OBJS)\n", NULL ); Rule gasRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).o.d: $(source) | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -x assembler-with-cpp -MF $@ -D__ASM__ $($(module_name)_CFLAGS) -M -MP -MT $@ $<\n" + "-include $(intermediate_path_unique).o.d\n" + "endif\n" + "$(intermediate_path_unique).o: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_GAS)\n" "\t${gcc} -x assembler-with-cpp -o $@ -D__ASM__ $($(module_name)_CFLAGS) -c $<\n", "$(intermediate_path_unique).o", + "$(intermediate_path_unique).o.d", "$(intermediate_dir)$(SEP)", NULL ); Rule bootRule ( "$(source): ${$(module_name)_precondition}\n" "$(module_output): $(source)$(dependencies) | $(OUTPUT)$(SEP)$(source_dir)\n" @@ -1076,7 +1083,13 @@ "$(intermediate_path_unique).o", "$(intermediate_dir)$(SEP)", NULL ); Rule windresRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_unique).coff: $(source)$(dependencies) $(WRC_TARGET) | $(intermediate_dir) $(TEMPORARY)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).coff.d: $(source) | $(intermediate_dir) $(TEMPORARY)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -xc -M -MP -MT $@ -DRC_INVOKED ${$(module_name)_RCFLAGS} $(source) -MF $@\n" + "-include $(intermediate_path_unique).coff.d\n" + "endif\n" + "$(intermediate_path_unique).coff: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).coff.d)$(dependencies) $(WRC_TARGET) | $(intermediate_dir) $(TEMPORARY)\n" "\t$(ECHO_WRC)\n" "\t${gcc} -xc -E -DRC_INVOKED ${$(module_name)_RCFLAGS} $(source) > $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).rci.tmp\n" "\t$(Q)$(WRC_TARGET) ${$(module_name)_RCFLAGS} $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).rci.tmp $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).res.tmp\n" @@ -1084,6 +1097,7 @@ "\t${windres} $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).res.tmp -o $@\n" "\t-@${rm} $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).res.tmp 2>$(NUL)\n", "$(intermediate_path_unique).coff", + "$(intermediate_path_unique).coff.d", "$(intermediate_dir)$(SEP)", NULL ); Rule wmcRule ( "$(intermediate_path_noext).rc $(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h: $(WMC_TARGET) $(source) | $(intermediate_dir)\n" "\t$(ECHO_WMC)\n" @@ -1091,24 +1105,38 @@ "$(intermediate_path_noext).rc", "$(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h", "$(intermediate_dir)$(SEP)", NULL ); -Rule winebuildPDefRule ( "$(intermediate_path_unique).spec: $(source)$(dependencies) | $(intermediate_dir)\n" +Rule winebuildPDefRule ( "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).spec.d: $(source) | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -xc -M -MP -MT $@ ${$(module_name)_RCFLAGS} $(source) -MF $@\n\n" + "-include $(intermediate_path_unique).spec.d\n" + "endif\n" + "$(intermediate_path_unique).spec: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).spec.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CPP)\n" "\t${gcc} -xc -E ${$(module_name)_RCFLAGS} $(source) > $(intermediate_path_unique).spec\n\n" "$(intermediate_path_unique).auto.def: $(intermediate_path_unique).spec $(WINEBUILD_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WINEBLD)\n" "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(intermediate_path_unique).auto.def --def -E $(intermediate_path_unique).spec --filename $(module_dllname)\n\n", "$(intermediate_path_unique).spec", + "$(intermediate_path_unique).spec.d", "$(intermediate_path_unique).auto.def", "$(intermediate_dir)$(SEP)", NULL ); Rule winebuildPRule ( "$(intermediate_path_unique).stubs.c: $(intermediate_path_unique).spec $(WINEBUILD_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WINEBLD)\n" "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $@ --pedll $(intermediate_path_unique).spec --filename $(module_dllname)\n\n" - "$(intermediate_path_unique).stubs.o: $(intermediate_path_unique).stubs.c | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).stubs.o.d: $(intermediate_path_unique).stubs.c | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -M -MP -MT $@ $<\n" + "-include $(intermediate_path_unique).stubs.o.d\n" + "endif\n" + "$(intermediate_path_unique).stubs.o: $(intermediate_path_unique).stubs.c$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).stubs.o.d) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", "$(intermediate_path_unique).spec", "$(intermediate_path_unique).stubs.c", "$(intermediate_path_unique).stubs.o", + "$(intermediate_path_unique).stubs.o.d", "$(intermediate_dir)$(SEP)", NULL ); Rule winebuildDefRule ( "$(intermediate_path_unique).auto.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WINEBLD)\n" @@ -1119,87 +1147,144 @@ Rule winebuildRule ( "$(intermediate_path_unique).stubs.c: $(source) $(WINEBUILD_TARGET)\n" "\t$(ECHO_WINEBLD)\n" "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $@ --pedll $(source) --filename $(module_dllname)\n" - "$(intermediate_path_unique).stubs.o: $(intermediate_path_unique).stubs.c$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).stubs.o.d: $(intermediate_path_unique).stubs.c | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -M -MP -MT $@ $<\n" + "-include $(intermediate_path_unique).stubs.o.d\n" + "endif\n" + "$(intermediate_path_unique).stubs.o: $(intermediate_path_unique).stubs.c$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).stubs.o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", "$(intermediate_path_unique).stubs.c", "$(intermediate_path_unique).stubs.o", + "$(intermediate_path_unique).stubs.o.d", "$(intermediate_dir)$(SEP)", NULL ); Rule widlHeaderRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_noext).h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" + "$(intermediate_path_noext).h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WIDL)\n" "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(intermediate_path_noext).h $(source)\n", "$(intermediate_path_noext).h", "$(intermediate_dir)$(SEP)", NULL ); Rule widlServerRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_noext)_s.c $(intermediate_path_noext)_s.h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" + "$(intermediate_path_noext)_s.c $(intermediate_path_noext)_s.h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WIDL)\n" "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(intermediate_path_noext)_s.h -s -S $(intermediate_path_noext)_s.c $(source)\n" - "$(intermediate_path_noext)_s.o: $(intermediate_path_noext)_s.c $(intermediate_path_noext)_s.h$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_noext)_s.o.d: $(intermediate_path_noext)_s.c | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -M -MP -MT $@ $<\n" + "-include $(intermediate_path_noext)_s.o.d\n" + "endif\n" + "$(intermediate_path_noext)_s.o: $(intermediate_path_noext)_s.c $(intermediate_path_noext)_s.h$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_noext)_s.o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -c $<\n", "$(intermediate_path_noext)_s.h", "$(intermediate_path_noext)_s.c", "$(intermediate_path_noext)_s.o", + "$(intermediate_path_noext)_s.o.d", "$(intermediate_dir)$(SEP)", NULL ); Rule widlClientRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_noext)_c.c $(intermediate_path_noext)_c.h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" + "$(intermediate_path_noext)_c.c $(intermediate_path_noext)_c.h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WIDL)\n" "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(intermediate_path_noext)_c.h -c -C $(intermediate_path_noext)_c.c $(source)\n" - "$(intermediate_path_noext)_c.o: $(intermediate_path_noext)_c.c $(intermediate_path_noext)_c.h$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_noext)_c.o.d: $(intermediate_path_noext)_c.c | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -M -MP -MT $@ $<\n" + "-include $(intermediate_path_noext)_c.o.d\n" + "endif\n" + "$(intermediate_path_noext)_c.o: $(intermediate_path_noext)_c.c $(intermediate_path_noext)_c.h$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_noext)_c.o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -c $<\n", "$(intermediate_path_noext)_c.h", "$(intermediate_path_noext)_c.c", "$(intermediate_path_noext)_c.o", + "$(intermediate_path_noext)_c.o.d", "$(intermediate_dir)$(SEP)", NULL ); Rule widlProxyRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_noext)_p.c $(intermediate_path_noext)_p.h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" + "$(intermediate_path_noext)_p.c $(intermediate_path_noext)_p.h: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WIDL)\n" "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(intermediate_path_noext)_p.h -p -P $(intermediate_path_noext)_p.c $(source)\n" - "$(intermediate_path_noext)_p.o: $(intermediate_path_noext)_p.c $(intermediate_path_noext)_p.h$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_noext)_p.o.d: $(intermediate_path_noext)_p.c | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -M -MP -MT $@ $<\n" + "-include $(intermediate_path_noext)_p.o.d\n" + "endif\n" + "$(intermediate_path_noext)_p.o: $(intermediate_path_noext)_p.c $(intermediate_path_noext)_p.h$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_noext)_p.o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -c $<\n", "$(intermediate_path_noext)_p.h", "$(intermediate_path_noext)_p.c", "$(intermediate_path_noext)_p.o", + "$(intermediate_path_noext)_p.o.d", "$(intermediate_dir)$(SEP)", NULL ); Rule widlDlldataRule ( "$(source): $(dependencies) ${$(module_name)_precondition} $(WIDL_TARGET) | $(intermediate_dir)\n" - "\t$(ECHO_WIDL)\n" - "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) --dlldata-only --dlldata=$(source) $(bare_dependencies)\n" - "$(intermediate_path_noext).o: $(source) $(dependencies) | $(intermediate_dir)\n" - "\t$(ECHO_CC)\n" - "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", - "$(intermediate_path_noext).o", NULL ); + "\t$(ECHO_WIDL)\n" + "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) --dlldata-only --dlldata=$(source) $(bare_dependencies)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_noext).o.d: $(source) | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -M -MP -MT $@ $<\n" + "-include $(intermediate_path_noext).o.d\n" + "endif\n" + "$(intermediate_path_noext).o: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_noext).o.d)$(dependencies) | $(intermediate_dir)\n" + "\t$(ECHO_CC)\n" + "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", + "$(intermediate_path_noext).o", + "$(intermediate_path_noext).o.d", NULL ); Rule widlTlbRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_dir)$(SEP)$(module_name).tlb: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" + "$(intermediate_dir)$(SEP)$(module_name).tlb: $(source)$(dependencies) $(WIDL_TARGET) | $(intermediate_dir)\n" "\t$(ECHO_WIDL)\n" "\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -t -T $(intermediate_path_noext).tlb $(source)\n", "$(intermediate_dir)$(SEP)", NULL ); Rule gccRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).o.d: $(source) | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -M -MP -MT $@ $<\n" + "-include $(intermediate_path_unique).o.d\n" + "endif\n" + "$(intermediate_path_unique).o: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", - "$(intermediate_path_unique).o", NULL ); + "$(intermediate_path_unique).o", + "$(intermediate_path_unique).o.d", NULL ); Rule gccHostRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" + "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_HOSTCC)\n" "\t${host_gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", "$(intermediate_path_unique).o", NULL ); Rule gppRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_path_unique).o.d: $(source) | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t${gpp} -MF $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -M -MP -MT $@ $<\n" + "-include $(intermediate_path_unique).o.d\n" + "endif\n" + "$(intermediate_path_unique).o: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).o.d)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_CC)\n" "\t${gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -c $<\n", - "$(intermediate_path_unique).o", NULL ); + "$(intermediate_path_unique).o", + "$(intermediate_path_unique).o.d", NULL ); Rule gppHostRule ( "$(source): ${$(module_name)_precondition}\n" - "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" + "$(intermediate_path_unique).o: $(source)$(dependencies) | $(intermediate_dir)\n" "\t$(ECHO_HOSTCC)\n" "\t${host_gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -c $<\n", "$(intermediate_path_unique).o", NULL ); -Rule pchRule ( "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch: $(source)$(dependencies) | $(intermediate_dir)$(SEP).gch_$(module_name)\n" +Rule pchRule ( "$(source): ${$(module_name)_precondition}\n" + "ifeq ($(ROS_BUILDDEPS),full)\n" + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d: $(source) | $(intermediate_dir)\n" + "\t$(ECHO_DEPENDS)\n" + "\t$(pch_cc) -MF $@ $(pch_ccflags)$(compiler_flags) -x $(pch_language) -M -MP -MT $@ $<\n" + "-include $(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d\n" + "endif\n" + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch: $(source)$(if $(subst _full,,_$(ROS_BUILDDEPS)),, $(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d)$(dependencies) | $(intermediate_dir)$(SEP).gch_$(module_name)\n" "\t$(ECHO_PCH)\n" "\t$(pch_cc) -o $@ $(pch_ccflags)$(compiler_flags) -x $(pch_language) -c $<\n", - "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch", NULL ); + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d", NULL ); Rule emptyRule ( "", NULL ); void Modified: trunk/reactos/tools/rbuild/configuration.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/configuration…
============================================================================== --- trunk/reactos/tools/rbuild/configuration.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/configuration.cpp [iso-8859-1] Sun Jan 25 10:19:45 2009 @@ -24,7 +24,7 @@ { Verbose = false; CleanAsYouGo = false; - AutomaticDependencies = true; + Dependencies = AutomaticDependencies; CheckDependenciesForModuleOnly = false; CompilationUnitsEnabled = true; PrecompiledHeadersEnabled = true; Modified: trunk/reactos/tools/rbuild/rbuild.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.cpp?re…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/rbuild.cpp [iso-8859-1] Sun Jan 25 10:19:45 2009 @@ -45,7 +45,13 @@ switch ( switchChar2 ) { case 'd': - configuration.AutomaticDependencies = false; + configuration.Dependencies = NoDependencies; + break; + case 'a': + configuration.Dependencies = AutomaticDependencies; + break; + case 'f': + configuration.Dependencies = FullDependencies; break; case 'm': if ( strlen ( switchStart ) <= 3 ) @@ -293,6 +299,8 @@ printf ( " -c Clean as you go. Delete generated files as soon as they are not\n" ); printf ( " needed anymore.\n" ); printf ( " -dd Disable automatic dependencies.\n" ); + printf ( " -da Enable automatic dependencies.\n" ); + printf ( " -df Enable full dependencies.\n" ); printf ( " -dm{module} Check only automatic dependencies for this module.\n" ); printf ( " -ud Disable multiple source files per compilation unit.\n" ); printf ( " -mi Let make handle creation of install directories. Rbuild will\n" ); Modified: trunk/reactos/tools/rbuild/rbuild.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/rbuild.h [iso-8859-1] Sun Jan 25 10:19:45 2009 @@ -148,6 +148,12 @@ bool verbose ); }; +enum DependenciesType +{ + NoDependencies, + AutomaticDependencies, + FullDependencies +}; class Configuration { @@ -156,7 +162,7 @@ ~Configuration (); bool Verbose; bool CleanAsYouGo; - bool AutomaticDependencies; + DependenciesType Dependencies; bool CheckDependenciesForModuleOnly; bool CompilationUnitsEnabled; bool PrecompiledHeadersEnabled;
15 years, 11 months
1
0
0
0
[sginsberg] 39092: - Deprecate global helper.h -- define the various 'helpful macros' per module
by sginsberg@svn.reactos.org
Author: sginsberg Date: Sun Jan 25 10:13:16 2009 New Revision: 39092 URL:
http://svn.reactos.org/svn/reactos?rev=39092&view=rev
Log: - Deprecate global helper.h -- define the various 'helpful macros' per module Removed: trunk/reactos/include/reactos/helper.h Modified: trunk/reactos/base/setup/usetup/usetup.h trunk/reactos/boot/freeldr/freeldr/include/freeldr.h trunk/reactos/dll/directx/ksuser/ksuser.h trunk/reactos/dll/ntdll/include/ntdll.h trunk/reactos/dll/ntdll/ldr/utils.c trunk/reactos/dll/win32/kernel32/file/iocompl.c trunk/reactos/dll/win32/kernel32/include/kernel32.h trunk/reactos/dll/win32/kernel32/k32.h trunk/reactos/dll/win32/kernel32/misc/version.c trunk/reactos/drivers/filesystems/fastfat/vfat.h trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c trunk/reactos/drivers/video/videoprt/videoprt.h trunk/reactos/hal/halarm/include/hal.h trunk/reactos/hal/halppc/include/hal.h trunk/reactos/hal/halx86/include/hal.h trunk/reactos/lib/fslib/vfatlib/check/vfat.h trunk/reactos/lib/ppcmmu/mmuobject.c trunk/reactos/lib/rtl/env.c trunk/reactos/lib/rtl/image.c trunk/reactos/lib/rtl/ppb.c trunk/reactos/lib/rtl/rtl.h trunk/reactos/lib/rtl/rtlp.h trunk/reactos/lib/sdk/crt/precomp.h trunk/reactos/lib/sdk/crt/stdlib/malloc.c trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h trunk/reactos/ntoskrnl/include/precomp.h trunk/reactos/subsystems/win32/win32k/pch.h Modified: trunk/reactos/base/setup/usetup/usetup.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h…
============================================================================== --- trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -44,9 +44,6 @@ /* DDK Disk Headers */ #include <ntddscsi.h> - -/* Helper Header */ -#include <reactos/helper.h> /* ReactOS Version */ #include <reactos/buildno.h> @@ -125,6 +122,34 @@ #define POPUP_WAIT_ANY_KEY 1 #define POPUP_WAIT_ENTER 2 +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) + +#define LIST_FOR_EACH(elem, list, type, field) \ + for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \ + &(elem)->field != (list) || (elem == NULL); \ + (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field)) + +#define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\ +{\ + PLIST_ENTRY current;\ +\ + current = (ListHead)->Flink;\ + while (current != (ListHead))\ + {\ + if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\ + (NewEntry)->SortField)\ + {\ + break;\ + }\ + current = current->Flink;\ + }\ +\ + InsertTailList(current, &((NewEntry)->ListEntryField));\ +} #endif /* __USETUP_H__*/ Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -21,6 +21,13 @@ #define __FREELDR_H #define UINT64_C(val) val##ULL +#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m))) + +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) #define NTOSAPI #define printf TuiPrintf @@ -94,7 +101,6 @@ /* Externals */ #include <reactos/rossym.h> #include <reactos/buildno.h> -#include <reactos/helper.h> /* Needed if debuging is enabled */ #include <comm.h> /* Swap */ Modified: trunk/reactos/dll/directx/ksuser/ksuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
============================================================================== --- trunk/reactos/dll/directx/ksuser/ksuser.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksuser/ksuser.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -9,7 +9,6 @@ #include <ks.h> -#include <reactos/helper.h> LPVOID __stdcall @@ -19,4 +18,10 @@ DWORD dwBytes ); +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) + #endif Modified: trunk/reactos/dll/ntdll/include/ntdll.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/include/ntdll.h?…
============================================================================== --- trunk/reactos/dll/ntdll/include/ntdll.h [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/include/ntdll.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -32,7 +32,4 @@ /* CSRSS Header */ #include <csrss/csrss.h> -/* Helper Macros */ -#include <reactos/helper.h> - /* EOF */ Modified: trunk/reactos/dll/ntdll/ldr/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -22,6 +22,7 @@ #include <debug.h> #define LDRP_PROCESS_CREATION_TIME 0x8000000 +#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m))) /* GLOBALS *******************************************************************/ Modified: trunk/reactos/dll/win32/kernel32/file/iocompl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/io…
============================================================================== --- trunk/reactos/dll/win32/kernel32/file/iocompl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/file/iocompl.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -12,6 +12,10 @@ #include <k32.h> #include <wine/debug.h> +#define NANOS_TO_100NS(nanos) (((LONGLONG)(nanos)) / 100) +#define MICROS_TO_100NS(micros) (((LONGLONG)(micros)) * NANOS_TO_100NS(1000)) +#define MILLIS_TO_100NS(milli) (((LONGLONG)(milli)) * MICROS_TO_100NS(1000)) + WINE_DEFAULT_DEBUG_CHANNEL(kernel32file); /* @@ -110,7 +114,7 @@ if (dwMilliseconds != INFINITE) { - Interval.QuadPart = RELATIVE_TIME(MILLIS_TO_100NS(dwMilliseconds)); + Interval.QuadPart = (-(MILLIS_TO_100NS(dwMilliseconds))); } errCode = NtRemoveIoCompletion(CompletionHandle, Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -20,6 +20,12 @@ #define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b)) #define ROUNDDOWN(a,b) (((a)/(b))*(b)) + +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) #ifndef FIELD_OFFSET #define FIELD_OFFSET(type,fld) ((LONG)&(((type *)0)->fld)) Modified: trunk/reactos/dll/win32/kernel32/k32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/k32.h?r…
============================================================================== --- trunk/reactos/dll/win32/kernel32/k32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/k32.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -41,7 +41,4 @@ /* PSEH for SEH Support */ #include <pseh/pseh2.h> -/* Helper Header */ -#include <reactos/helper.h> - #endif Modified: trunk/reactos/dll/win32/kernel32/misc/version.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ve…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/version.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/version.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -15,6 +15,8 @@ #define NDEBUG #include <debug.h> +#define UNICODIZE1(x) L##x +#define UNICODIZE(x) UNICODIZE1(x) /* FUNCTIONS ******************************************************************/ Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -1,6 +1,5 @@ #include <ntifs.h> #include <ntdddisk.h> -#include <reactos/helper.h> #include <debug.h> #ifdef __GNUC__ @@ -13,6 +12,12 @@ #define ROUND_DOWN(N, S) ((N) - ((N) % (S))) #define ROUND_UP(N, S) ROUND_DOWN((N) + (S) - 1, (S)) #endif + +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) #include <pshpack1.h> struct _BootSector Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -1,6 +1,5 @@ #include <ntifs.h> #include <ntdddisk.h> -#include <reactos/helper.h> #include <debug.h> #ifndef TAG Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
============================================================================== --- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -17,7 +17,6 @@ #include <ntddvol.h> #include <mountdev.h> #include <mountmgr.h> -#include <helper.h> #include <ketypes.h> #include <iotypes.h> #include <rtlfuncs.h> Modified: trunk/reactos/drivers/video/videoprt/videoprt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/vid…
============================================================================== --- trunk/reactos/drivers/video/videoprt/videoprt.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/videoprt/videoprt.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -31,7 +31,6 @@ #include <ntagp.h> #include <ntifs.h> #include <ndk/ntndk.h> -#include <reactos/helper.h> #include <dderror.h> #include <windef.h> Modified: trunk/reactos/hal/halarm/include/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/include/hal.h?r…
============================================================================== --- trunk/reactos/hal/halarm/include/hal.h [iso-8859-1] (original) +++ trunk/reactos/hal/halarm/include/hal.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -37,7 +37,4 @@ /* Internal HAL Headers */ #include "halp.h" -/* Helper Header */ -#include <reactos/helper.h> - /* EOF */ Modified: trunk/reactos/hal/halppc/include/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halppc/include/hal.h?r…
============================================================================== --- trunk/reactos/hal/halppc/include/hal.h [iso-8859-1] (original) +++ trunk/reactos/hal/halppc/include/hal.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -47,7 +47,4 @@ #include "mps.h" #include "ioapic.h" -/* Helper Header */ -#include <reactos/helper.h> - /* EOF */ Modified: trunk/reactos/hal/halx86/include/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/hal.h?r…
============================================================================== --- trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -46,7 +46,4 @@ #include "mps.h" #include "ioapic.h" -/* Helper Header */ -#include <reactos/helper.h> - /* EOF */ Removed: trunk/reactos/include/reactos/helper.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/helper.h?r…
============================================================================== --- trunk/reactos/include/reactos/helper.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/helper.h (removed) @@ -1,145 +1,0 @@ -#ifndef _HELPER_H -#define _HELPER_H - -#ifndef ROUND_UP -#define ROUND_UP(n, align) \ - ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) -#endif - -#ifndef ROUND_DOWN -#define ROUND_DOWN(n, align) \ - (((ULONG)n) & ~((align) - 1l)) -#endif - -#ifndef ROUNDUP -#define ROUNDUP ROUND_UP -#endif - -#ifndef ROUNDDOWN -#define ROUNDDOWN ROUND_DOWN -#endif - -#ifndef PAGE_ROUND_DOWN -#define PAGE_ROUND_DOWN(x) (((ULONG_PTR)(x))&(~(PAGE_SIZE-1))) -#endif - -#ifndef PAGE_ROUND_UP -#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)) ) -#endif - -/* iterate through the list using a list entry. - * elem is set to NULL if the list is run thru without breaking out or if list is empty. - */ -#define LIST_FOR_EACH(elem, list, type, field) \ - for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \ - &(elem)->field != (list) || (elem == NULL); \ - (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field)) - -/* iterate through the list using a list entry, with safety against removal - * elem is set to NULL if the list is run thru without breaking out or if list is empty. - */ -#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \ - for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \ - (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \ - &(cursor)->field != (list) || (cursor == NULL); \ - (cursor) = (cursor2), \ - (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field)) - -#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \ - ((PIMAGE_DOS_HEADER)a)->e_lfanew + \ - sizeof (IMAGE_NT_SIGNATURE) + \ - sizeof (IMAGE_FILE_HEADER))) -#ifndef TAG -#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) -#endif -#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m))) -#define NTSTAT_SEVERITY_SHIFT 30 -#define NTSTAT_SEVERITY_MASK 0x00000003 -#define NTSTAT_FACILITY_SHIFT 16 -#define NTSTAT_FACILITY_MASK 0x00000FFF -#define NTSTAT_CUSTOMER_MASK 0x20000000 -#define NT_SEVERITY(StatCode) (((StatCode) >> NTSTAT_SEVERITY_SHIFT) & NTSTAT_SEVERITY_MASK) -#define NT_FACILITY(StatCode) (((StatCode) >> NTSTAT_FACILITY_SHIFT) & NTSTAT_FACILITY_MASK) -#define NT_CUSTOMER(StatCode) ((StatCode) & NTSTAT_CUSTOMER_MASK) -#define RELATIVE_TIME(wait) (-(wait)) -#define NANOS_TO_100NS(nanos) (((LONGLONG)(nanos)) / 100) -#define MICROS_TO_100NS(micros) (((LONGLONG)(micros)) * NANOS_TO_100NS(1000)) -#define MILLIS_TO_100NS(milli) (((LONGLONG)(milli)) * MICROS_TO_100NS(1000)) -#define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000)) -#define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60)) -#define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60)) -#define UNICODIZE1(x) L##x -#define UNICODIZE(x) UNICODIZE1(x) -#define InsertAscendingListFIFO(ListHead, NewEntry, Type, ListEntryField, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#define InsertDescendingListFIFO(ListHead, NewEntry, Type, ListEntryField, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#define InsertDescendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#endif Modified: trunk/reactos/lib/fslib/vfatlib/check/vfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/vf…
============================================================================== --- trunk/reactos/lib/fslib/vfatlib/check/vfat.h [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/vfatlib/check/vfat.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -3,7 +3,6 @@ #include <ddk/ntifs.h> #include <ddk/ntdddisk.h> #include <ndk/ntndk.h> -#include <reactos/helper.h> #include <ccros.h> #include <limits.h> #include <debug.h> Modified: trunk/reactos/lib/ppcmmu/mmuobject.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/ppcmmu/mmuobject.c?rev…
============================================================================== --- trunk/reactos/lib/ppcmmu/mmuobject.c [iso-8859-1] (original) +++ trunk/reactos/lib/ppcmmu/mmuobject.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -2,7 +2,6 @@ #include "ppcmmu/mmu.h" #include "ppcmmu/mmuutil.h" #include "mmuobject.h" -#include "helper.h" typedef unsigned long ULONG; Modified: trunk/reactos/lib/rtl/env.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/env.c?rev=39092&r1…
============================================================================== --- trunk/reactos/lib/rtl/env.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/env.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -368,7 +368,7 @@ /* enlarge environment size */ /* check the size of available memory */ new_size += (env_len - hole_len) * sizeof(WCHAR); - new_size = ROUNDUP(new_size, PAGE_SIZE); + new_size = ROUND_UP(new_size, PAGE_SIZE); mbi.RegionSize = 0; DPRINT("new_size %lu\n", new_size); Modified: trunk/reactos/lib/rtl/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/image.c?rev=39092&…
============================================================================== --- trunk/reactos/lib/rtl/image.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/image.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -15,6 +15,8 @@ #define NDEBUG #include <debug.h> + +#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m))) /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/lib/rtl/ppb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/ppb.c?rev=39092&r1…
============================================================================== --- trunk/reactos/lib/rtl/ppb.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/ppb.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -121,7 +121,7 @@ Length += ALIGN(RuntimeData->MaximumLength, sizeof(ULONG)); /* Calculate the required block size */ - RegionSize = ROUNDUP(Length, PAGE_SIZE); + RegionSize = ROUND_UP(Length, PAGE_SIZE); Status = ZwAllocateVirtualMemory(NtCurrentProcess(), (PVOID*)&Param, Modified: trunk/reactos/lib/rtl/rtl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.h?rev=39092&r1…
============================================================================== --- trunk/reactos/lib/rtl/rtl.h [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/rtl.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -28,7 +28,6 @@ #include "rtlp.h" /* PSEH Support */ -#include <reactos/helper.h> #include <pseh/pseh2.h> #include <intrin.h> Modified: trunk/reactos/lib/rtl/rtlp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtlp.h?rev=39092&r…
============================================================================== --- trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -23,6 +23,12 @@ #define SWAPD(x) x #define SWAPW(x) x #endif + +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) VOID NTAPI Modified: trunk/reactos/lib/sdk/crt/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/precomp.h?rev=…
============================================================================== --- trunk/reactos/lib/sdk/crt/precomp.h [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/precomp.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -28,7 +28,6 @@ #define WIN32_NO_STATUS #include <windows.h> #include <ndk/ntndk.h> -#include <reactos/helper.h> #if !defined(_MSC_VER) #include <stdint.h> Modified: trunk/reactos/lib/sdk/crt/stdlib/malloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/malloc.…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdlib/malloc.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdlib/malloc.c [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -25,6 +25,11 @@ #include <stdlib.h> #include <malloc.h> +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) /* round to 16 bytes + alloc at minimum 16 bytes */ #define ROUND_SIZE(size) (max(16, ROUND_UP(size, 16))) Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -23,6 +23,8 @@ #endif #undef PsGetCurrentProcess #define PsGetCurrentProcess _PsGetCurrentProcess + +#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m))) // // We are very lazy on ARM -- we just import intrinsics Modified: trunk/reactos/ntoskrnl/include/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/precomp.h…
============================================================================== --- trunk/reactos/ntoskrnl/include/precomp.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/precomp.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -63,9 +63,6 @@ /* PNP GUIDs */ #include <umpnpmgr/sysguid.h> -/* Helper Header */ -#include <reactos/helper.h> - /* Internal Headers */ #include "internal/ntoskrnl.h" #include "config.h" Modified: trunk/reactos/subsystems/win32/win32k/pch.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/pc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/pch.h [iso-8859-1] Sun Jan 25 10:13:16 2009 @@ -42,9 +42,6 @@ /* CSRSS Header */ #include <csrss/csrss.h> - -/* Helper Header */ -#include <reactos/helper.h> /* Public Win32K Headers */ #include <win32k/callback.h> @@ -139,4 +136,22 @@ (ULONG_PTR)W32Process->HeapMappings.UserMapping); } +#define ROUND_DOWN(n, align) \ + (((ULONG)n) & ~((align) - 1l)) + +#define ROUND_UP(n, align) \ + ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) + +#define LIST_FOR_EACH(elem, list, type, field) \ + for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \ + &(elem)->field != (list) || (elem == NULL); \ + (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field)) + +#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \ + for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \ + (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \ + &(cursor)->field != (list) || (cursor == NULL); \ + (cursor) = (cursor2), \ + (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field)) + #endif /* __W32K_H */
15 years, 11 months
1
0
0
0
[dchapyshev] 39091: - Add stubs for internalConfig, internalNewLocationW, internalRemoveLocation, internalRenameLocationW
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Jan 25 08:30:57 2009 New Revision: 39091 URL:
http://svn.reactos.org/svn/reactos?rev=39091&view=rev
Log: - Add stubs for internalConfig, internalNewLocationW, internalRemoveLocation, internalRenameLocationW Added: trunk/reactos/dll/win32/tapi32/internal.c (with props) Modified: trunk/reactos/dll/win32/tapi32/tapi32.rbuild trunk/reactos/dll/win32/tapi32/tapi32.spec Added: trunk/reactos/dll/win32/tapi32/internal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/tapi32/internal.…
============================================================================== --- trunk/reactos/dll/win32/tapi32/internal.c (added) +++ trunk/reactos/dll/win32/tapi32/internal.c [iso-8859-1] Sun Jan 25 08:30:57 2009 @@ -1,0 +1,71 @@ +/* + * TAPI32 internal functions + * + * Copyright 2008 Dmitry Chapyshev + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <string.h> +#include <stdlib.h> +#include <stdarg.h> +#include <stdio.h> +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winreg.h" +#include "winnls.h" +#include "winerror.h" +#include "objbase.h" +#include "tapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(tapi); + +/*********************************************************************** + * internalConfig (TAPI32.@) + */ +LONG WINAPI internalConfig(HWND hParentWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2) +{ + FIXME("internalConfig() not implemented!\n"); + return 0; +} + +/*********************************************************************** + * internalNewLocationW (TAPI32.@) + */ +DWORD WINAPI internalNewLocationW(LPWSTR lpName) +{ + FIXME("internalNewLocationW() not implemented!\n"); + return 0; +} + +/*********************************************************************** + * internalRemoveLocation (TAPI32.@) + */ +DWORD WINAPI internalRemoveLocation(DWORD dwLocationId) +{ + FIXME("internalRemoveLocation() not implemented!\n"); + return 0; +} + +/*********************************************************************** + * internalRenameLocationW (TAPI32.@) + */ +DWORD WINAPI internalRenameLocationW(WCHAR *szPrevName, WCHAR *szNewName) +{ + FIXME("internalRenameLocationW() not implemented!\n"); + return 0; +} Propchange: trunk/reactos/dll/win32/tapi32/internal.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/tapi32/tapi32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/tapi32/tapi32.rb…
============================================================================== --- trunk/reactos/dll/win32/tapi32/tapi32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/tapi32/tapi32.rbuild [iso-8859-1] Sun Jan 25 08:30:57 2009 @@ -7,6 +7,7 @@ <include base="ReactOS">include/reactos/wine</include> <define name="__WINESRC__" /> <file>assisted.c</file> + <file>internal.c</file> <file>line.c</file> <file>phone.c</file> <library>wine</library> Modified: trunk/reactos/dll/win32/tapi32/tapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/tapi32/tapi32.sp…
============================================================================== --- trunk/reactos/dll/win32/tapi32/tapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/tapi32/tapi32.spec [iso-8859-1] Sun Jan 25 08:30:57 2009 @@ -21,12 +21,12 @@ @ stub NonAsyncEventThread @ stub TAPIWndProc @ stub TUISPIDLLCallback -@ stub internalConfig +@ stdcall internalConfig(ptr long ptr ptr) @ stub internalCreateDefLocation -@ stub internalNewLocationW +@ stdcall internalNewLocationW(wstr) @ stub internalPerformance -@ stub internalRemoveLocation -@ stub internalRenameLocationW +@ stdcall internalRemoveLocation(long) +@ stdcall internalRenameLocationW(wstr wstr) @ stdcall lineAccept(long str long) @ stdcall lineAddProvider(str long ptr) lineAddProviderA @ stdcall lineAddProviderA(str long ptr)
15 years, 11 months
1
0
0
0
[dchapyshev] 39090: - Add missed functions
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Jan 25 06:56:00 2009 New Revision: 39090 URL:
http://svn.reactos.org/svn/reactos?rev=39090&view=rev
Log: - Add missed functions Modified: trunk/reactos/dll/win32/tapi32/tapi32.spec Modified: trunk/reactos/dll/win32/tapi32/tapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/tapi32/tapi32.sp…
============================================================================== --- trunk/reactos/dll/win32/tapi32/tapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/tapi32/tapi32.spec [iso-8859-1] Sun Jan 25 06:56:00 2009 @@ -1,10 +1,41 @@ +@ stub GetTapi16CallbackMsg +@ stub LAddrParamsInited +@ stub LOpenDialAsst +@ stub LocWizardDlgProc +@ stub MMCAddProvider +@ stub MMCConfigProvider +@ stub MMCGetAvailableProviders +@ stub MMCGetDeviceFlags +@ stub MMCGetLineInfo +@ stub MMCGetLineStatus +@ stub MMCGetPhoneInfo +@ stub MMCGetPhoneStatus +@ stub MMCGetProviderList +@ stub MMCGetServerConfig +@ stub MMCInitialize +@ stub MMCRemoveProvider +@ stub MMCSetLineInfo +@ stub MMCSetPhoneInfo +@ stub MMCSetServerConfig +@ stub MMCShutdown +@ stub NonAsyncEventThread +@ stub TAPIWndProc +@ stub TUISPIDLLCallback +@ stub internalConfig +@ stub internalCreateDefLocation +@ stub internalNewLocationW +@ stub internalPerformance +@ stub internalRemoveLocation +@ stub internalRenameLocationW @ stdcall lineAccept(long str long) @ stdcall lineAddProvider(str long ptr) lineAddProviderA @ stdcall lineAddProviderA(str long ptr) @ stdcall lineAddToConference(long long) +@ stub lineAgentSpecific @ stdcall lineAnswer(long str long) @ stdcall lineBlindTransfer(long str long) lineBlindTransferA @ stdcall lineBlindTransferA(long str long) +@ stub lineBlindTransferW @ stdcall lineClose(long) @ stdcall lineCompleteCall(long ptr long long) @ stdcall lineCompleteTransfer(long long ptr long) @@ -12,60 +43,105 @@ @ stdcall lineConfigDialogA(long long str) @ stdcall lineConfigDialogEdit(long long str ptr long ptr) lineConfigDialogEditA @ stdcall lineConfigDialogEditA(long long str ptr long ptr) +@ stub lineConfigDialogEditW +@ stub lineConfigDialogW @ stdcall lineConfigProvider(long long) +@ stub lineCreateAgentA +@ stub lineCreateAgentSessionA +@ stub lineCreateAgentSessionW +@ stub lineCreateAgentW @ stdcall lineDeallocateCall(long) @ stdcall lineDevSpecific(long long long ptr long) @ stdcall lineDevSpecificFeature(long long ptr long) @ stdcall lineDial(long str long) lineDialA @ stdcall lineDialA(long str long) +@ stub lineDialW @ stdcall lineDrop(long str long) @ stdcall lineForward(long long long ptr long ptr ptr) lineForwardA @ stdcall lineForwardA(long long long ptr long ptr ptr) +@ stub lineForwardW @ stdcall lineGatherDigits(long long str long str long long) lineGatherDigitsA @ stdcall lineGatherDigitsA(long long str long str long long) +@ stub lineGatherDigitsW @ stdcall lineGenerateDigits(long long str long) lineGenerateDigitsA @ stdcall lineGenerateDigitsA(long long str long) +@ stub lineGenerateDigitsW @ stdcall lineGenerateTone(long long long long ptr) @ stdcall lineGetAddressCaps(long long long long long ptr) lineGetAddressCapsA @ stdcall lineGetAddressCapsA(long long long long long ptr) +@ stub lineGetAddressCapsW @ stdcall lineGetAddressID(long ptr long str long) lineGetAddressIDA @ stdcall lineGetAddressIDA(long ptr long str long) +@ stub lineGetAddressIDW @ stdcall lineGetAddressStatus(long long ptr) lineGetAddressStatusA @ stdcall lineGetAddressStatusA(long long ptr) +@ stub lineGetAddressStatusW +@ stub lineGetAgentActivityListA +@ stub lineGetAgentActivityListW +@ stub lineGetAgentCapsA +@ stub lineGetAgentCapsW +@ stub lineGetAgentGroupListA +@ stub lineGetAgentGroupListW +@ stub lineGetAgentInfo +@ stub lineGetAgentSessionInfo +@ stub lineGetAgentSessionList +@ stub lineGetAgentStatusA +@ stub lineGetAgentStatusW @ stdcall lineGetAppPriority(str long ptr long ptr ptr) lineGetAppPriorityA @ stdcall lineGetAppPriorityA(str long ptr long ptr ptr) +@ stub lineGetAppPriorityW @ stdcall lineGetCallInfo(long ptr) lineGetCallInfoA @ stdcall lineGetCallInfoA(long ptr) +@ stub lineGetCallInfoW @ stdcall lineGetCallStatus(long ptr) @ stdcall lineGetConfRelatedCalls(long ptr) @ stdcall lineGetCountry(long long ptr) lineGetCountryA @ stdcall lineGetCountryA(long long ptr) +@ stub lineGetCountryW @ stdcall lineGetDevCaps(long long long long ptr) lineGetDevCapsA @ stdcall lineGetDevCapsA(long long long long ptr) +@ stub lineGetDevCapsW @ stdcall lineGetDevConfig(long ptr str) lineGetDevConfigA @ stdcall lineGetDevConfigA(long ptr str) +@ stub lineGetDevConfigW +@ stub lineGetGroupListA +@ stub lineGetGroupListW @ stdcall lineGetID(long long long long ptr str) lineGetIDA @ stdcall lineGetIDA(long long long long ptr str) +@ stub lineGetIDW @ stdcall lineGetIcon(long str ptr) lineGetIconA @ stdcall lineGetIconA(long str ptr) +@ stub lineGetIconW @ stdcall lineGetLineDevStatus(long ptr) lineGetLineDevStatusA @ stdcall lineGetLineDevStatusA(long ptr) +@ stub lineGetLineDevStatusW +@ stub lineGetMessage @ stdcall lineGetNewCalls(long long long ptr) @ stdcall lineGetNumRings(long long ptr) @ stdcall lineGetProviderList(long ptr) lineGetProviderListA @ stdcall lineGetProviderListA(long ptr) +@ stub lineGetProviderListW +@ stub lineGetProxyStatus +@ stub lineGetQueueInfo +@ stub lineGetQueueInfoA +@ stub lineGetQueueInfoW @ stdcall lineGetRequest(long long ptr) lineGetRequestA @ stdcall lineGetRequestA(long long ptr) +@ stub lineGetRequestW @ stdcall lineGetStatusMessages(long ptr ptr) @ stdcall lineGetTranslateCaps(long long ptr) lineGetTranslateCapsA @ stdcall lineGetTranslateCapsA(long long ptr) +@ stub lineGetTranslateCapsW @ stdcall lineHandoff(long str long) lineHandoffA @ stdcall lineHandoffA(long str long) +@ stub lineHandoffW @ stdcall lineHold(long) @ stdcall lineInitialize(ptr long ptr str ptr) @ stdcall lineInitializeExA(ptr long ptr str ptr ptr ptr) +@ stub lineInitializeExW @ stdcall lineMakeCall(long ptr str long ptr) lineMakeCallA @ stdcall lineMakeCallA(long ptr str long ptr) +@ stub lineMakeCallW @ stdcall lineMonitorDigits(long long) @ stdcall lineMonitorMedia(long long) @ stdcall lineMonitorTones(long ptr long) @@ -73,77 +149,113 @@ @ stdcall lineNegotiateExtVersion(long long long long long ptr) @ stdcall lineOpen(long long ptr long long long long long ptr) lineOpenA @ stdcall lineOpenA(long long ptr long long long long long ptr) +@ stub lineOpenW @ stdcall linePark(long long str ptr) lineParkA @ stdcall lineParkA(long long str ptr) +@ stub lineParkW @ stdcall linePickup(long long ptr str str) linePickupA @ stdcall linePickupA(long long ptr str str) +@ stub linePickupW @ stdcall linePrepareAddToConference(long ptr ptr) linePrepareAddToConferenceA @ stdcall linePrepareAddToConferenceA(long ptr ptr) +@ stub linePrepareAddToConferenceW +@ stub lineProxyMessage +@ stub lineProxyResponse @ stdcall lineRedirect(long str long) lineRedirectA @ stdcall lineRedirectA(long str long) +@ stub lineRedirectW @ stdcall lineRegisterRequestRecipient(long long long long) @ stdcall lineReleaseUserUserInfo(long) @ stdcall lineRemoveFromConference(long) @ stdcall lineRemoveProvider(long long) @ stdcall lineSecureCall(long) @ stdcall lineSendUserUserInfo(long str long) +@ stub lineSetAgentActivity +@ stub lineSetAgentGroup +@ stub lineSetAgentMeasurementPeriod +@ stub lineSetAgentSessionState +@ stub lineSetAgentState +@ stub lineSetAgentStateEx @ stdcall lineSetAppPriority(str long ptr long str long) lineSetAppPriorityA @ stdcall lineSetAppPriorityA(str long ptr long str long) +@ stub lineSetAppPriorityW @ stdcall lineSetAppSpecific(long long) +@ stub lineSetCallData @ stdcall lineSetCallParams(long long long long ptr) @ stdcall lineSetCallPrivilege(long long) +@ stub lineSetCallQualityOfService +@ stub lineSetCallTreatment @ stdcall lineSetCurrentLocation(long long) @ stdcall lineSetDevConfig(long ptr long str) lineSetDevConfigA @ stdcall lineSetDevConfigA(long ptr long str) +@ stub lineSetDevConfigW +@ stub lineSetLineDevStatus @ stdcall lineSetMediaControl(long long long long ptr long ptr long ptr long ptr long) @ stdcall lineSetMediaMode(long long) @ stdcall lineSetNumRings(long long long) +@ stub lineSetQueueMeasurementPeriod @ stdcall lineSetStatusMessages(long long long) @ stdcall lineSetTerminal(long long long long long long long) @ stdcall lineSetTollList(long long str long) lineSetTollListA @ stdcall lineSetTollListA(long long str long) +@ stub lineSetTollListW @ stdcall lineSetupConference(long long ptr ptr long ptr) lineSetupConferenceA @ stdcall lineSetupConferenceA(long long ptr ptr long ptr) +@ stub lineSetupConferenceW @ stdcall lineSetupTransfer(long ptr ptr) lineSetupTransferA @ stdcall lineSetupTransferA(long ptr ptr) +@ stub lineSetupTransferW @ stdcall lineShutdown(long) @ stdcall lineSwapHold(long long) @ stdcall lineTranslateAddress(long long long str long long ptr) lineTranslateAddressA @ stdcall lineTranslateAddressA(long long long str long long ptr) +@ stub lineTranslateAddressW @ stdcall lineTranslateDialog(long long long long str) lineTranslateDialogA @ stdcall lineTranslateDialogA(long long long long str) +@ stub lineTranslateDialogW @ stdcall lineUncompleteCall(long long) @ stdcall lineUnhold(long) @ stdcall lineUnpark(long long ptr str) lineUnparkA @ stdcall lineUnparkA(long long ptr str) +@ stub lineUnparkW @ stdcall phoneClose(long) @ stdcall phoneConfigDialog(long long str) phoneConfigDialogA @ stdcall phoneConfigDialogA(long long str) +@ stub phoneConfigDialogW @ stdcall phoneDevSpecific(long ptr long) @ stdcall phoneGetButtonInfo(long long ptr) phoneGetButtonInfoA @ stdcall phoneGetButtonInfoA(long long ptr) +@ stub phoneGetButtonInfoW @ stdcall phoneGetData(long long ptr long) @ stdcall phoneGetDevCaps(long long long long ptr) phoneGetDevCapsA @ stdcall phoneGetDevCapsA(long long long long ptr) +@ stub phoneGetDevCapsW @ stdcall phoneGetDisplay(long ptr) @ stdcall phoneGetGain(long long ptr) @ stdcall phoneGetHookSwitch(long ptr) @ stdcall phoneGetID(long ptr str) phoneGetIDA @ stdcall phoneGetIDA(long ptr str) +@ stub phoneGetIDW @ stdcall phoneGetIcon(long str ptr) phoneGetIconA @ stdcall phoneGetIconA(long str ptr) +@ stub phoneGetIconW @ stdcall phoneGetLamp(long long ptr) +@ stub phoneGetMessage @ stdcall phoneGetRing(long ptr ptr) @ stdcall phoneGetStatus(long ptr) phoneGetStatusA @ stdcall phoneGetStatusA(long ptr) @ stdcall phoneGetStatusMessages(long ptr ptr ptr) +@ stub phoneGetStatusW @ stdcall phoneGetVolume(long long ptr) @ stdcall phoneInitialize(ptr long ptr str ptr) +@ stub phoneInitializeExA +@ stub phoneInitializeExW @ stdcall phoneNegotiateAPIVersion(long long long long ptr ptr) @ stdcall phoneNegotiateExtVersion(long long long long long ptr) @ stdcall phoneOpen(long long ptr long long long long) @ stdcall phoneSetButtonInfo(long long ptr) phoneSetButtonInfoA @ stdcall phoneSetButtonInfoA(long long ptr) +@ stub phoneSetButtonInfoW @ stdcall phoneSetData(long long ptr long) @ stdcall phoneSetDisplay(long long long str long) @ stdcall phoneSetGain(long long long) @@ -155,7 +267,11 @@ @ stdcall phoneShutdown(long) @ stdcall tapiGetLocationInfo(str str) tapiGetLocationInfoA @ stdcall tapiGetLocationInfoA(str str) -@ stub tapiRequestDrop +@ stub tapiGetLocationInfoW +@ stub tapiRequestDrop @ stdcall tapiRequestMakeCall(str str str str) tapiRequestMakeCallA @ stdcall tapiRequestMakeCallA(str str str str) -@ stub tapiRequestMediaCall +@ stub tapiRequestMakeCallW +@ stub tapiRequestMediaCall +@ stub tapiRequestMediaCallA +@ stub tapiRequestMediaCallW
15 years, 11 months
1
0
0
0
[dchapyshev] 39089: - Small fix
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Jan 25 05:55:02 2009 New Revision: 39089 URL:
http://svn.reactos.org/svn/reactos?rev=39089&view=rev
Log: - Small fix Modified: trunk/reactos/dll/cpl/telephon/telephon.c Modified: trunk/reactos/dll/cpl/telephon/telephon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/telephon.…
============================================================================== --- trunk/reactos/dll/cpl/telephon/telephon.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/telephon.c [iso-8859-1] Sun Jan 25 05:55:02 2009 @@ -48,6 +48,7 @@ if (!lpInternalConfig) return FALSE; lpInternalConfig(hwndCPl, 0, 0, 0); + FreeLibrary(hTapi32); return TRUE; } }
15 years, 11 months
1
0
0
0
[martinf] 39088: code beautification
by martinf@svn.reactos.org
Author: martinf Date: Sun Jan 25 05:54:31 2009 New Revision: 39088 URL:
http://svn.reactos.org/svn/reactos?rev=39088&view=rev
Log: code beautification Modified: trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp trunk/reactos/base/shell/explorer/taskbar/startmenu.h Modified: trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp [iso-8859-1] Sun Jan 25 05:54:31 2009 @@ -170,7 +170,7 @@ // prepare Startmenu, but hide it for now _startMenuRoot = GET_WINDOW(StartMenuRoot, StartMenuRoot::Create(_hwndStartButton, STARTMENUROOT_ICON_SIZE)); - _startMenuRoot->_hwndParent = _hwndStartButton; + _startMenuRoot->_hwndStartButton = _hwndStartButton; return 0; } Modified: trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] Sun Jan 25 05:54:31 2009 @@ -1557,7 +1557,8 @@ StartMenuRoot::StartMenuRoot(HWND hwnd, const StartMenuRootCreateInfo& info) - : super(hwnd, info._icon_size) + : super(hwnd, info._icon_size), + _hwndStartButton(0) { #ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCOMMONGROUPS)) @@ -1637,7 +1638,7 @@ // recalculate start menu root position RECT rect; - CalculateStartPos(_hwndParent, rect, _icon_size); + CalculateStartPos(_hwndStartButton, rect, _icon_size); SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0); Modified: trunk/reactos/base/shell/explorer/taskbar/startmenu.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/startmenu.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/startmenu.h [iso-8859-1] Sun Jan 25 05:54:31 2009 @@ -366,9 +366,11 @@ typedef StartMenuHandler super; StartMenuRoot(HWND hwnd, const StartMenuRootCreateInfo& info); - HWND _hwndParent; + static HWND Create(HWND hwndDesktopBar, int icon_size); void TrackStartmenu(); + + HWND _hwndStartButton; protected: LRESULT Init(LPCREATESTRUCT pcs);
15 years, 11 months
1
0
0
0
[dchapyshev] 39087: - Cleanup and implement telephon.cpl
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Jan 25 05:45:47 2009 New Revision: 39087 URL:
http://svn.reactos.org/svn/reactos?rev=39087&view=rev
Log: - Cleanup and implement telephon.cpl Removed: trunk/reactos/dll/cpl/telephon/telephon.h Modified: trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc trunk/reactos/dll/cpl/telephon/lang/de-DE.rc trunk/reactos/dll/cpl/telephon/lang/el-GR.rc trunk/reactos/dll/cpl/telephon/lang/en-US.rc trunk/reactos/dll/cpl/telephon/lang/es-ES.rc trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc trunk/reactos/dll/cpl/telephon/lang/it-IT.rc trunk/reactos/dll/cpl/telephon/lang/no-NO.rc trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc trunk/reactos/dll/cpl/telephon/resource.h trunk/reactos/dll/cpl/telephon/telephon.c Modified: trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/bg-B…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/bg-BG.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/de-D…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/de-DE.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/el-G…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/el-GR.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/en-U…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/en-US.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/es-E…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/es-ES.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/fr-F…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/fr-FR.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/it-I…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/it-IT.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/no-N…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/no-NO.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,13 +1,6 @@ // Norwegian (no) resources by LMH1 LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/pl-P…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/pl-PL.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -7,13 +7,6 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END - STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Opcje telefonu i modemu" Modified: trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/ru-R…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/ru-RU.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/sk-S…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/sk-SK.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,11 +1,4 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT - -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END STRINGTABLE BEGIN Modified: trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/lang/uk-U…
============================================================================== --- trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/lang/uk-UA.rc [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -8,13 +8,6 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT -IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 -STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "" -FONT 8, "MS Shell Dlg" -BEGIN -END - STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Òåëåôîí ³ ìîäåì" Modified: trunk/reactos/dll/cpl/telephon/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/resource.…
============================================================================== --- trunk/reactos/dll/cpl/telephon/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/resource.h [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -4,8 +4,6 @@ /* icons */ #define IDI_CPLSYSTEM 100 -/* dialogs */ -#define IDD_PROPPAGE 200 /* strings */ #define IDS_CPLSYSTEMNAME 1001 #define IDS_CPLSYSTEMDESCRIPTION 2001 Modified: trunk/reactos/dll/cpl/telephon/telephon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/telephon.…
============================================================================== --- trunk/reactos/dll/cpl/telephon/telephon.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/telephon.c [iso-8859-1] Sun Jan 25 05:45:47 2009 @@ -1,154 +1,62 @@ -/* - * ReactOS - * Copyright (C) 2007 ReactOS Team - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ /* * - * PROJECT: ReactOS Software Control Panel - * FILE: dll/cpl/telephon/telephon.c - * PURPOSE: ReactOS Software Control Panel - * PROGRAMMER: Dmitry Chapyshev (lentind(a)yandex.ru) + * PROJECT: ReactOS Software Control Panel + * FILE: dll/cpl/telephon/telephon.c + * PURPOSE: ReactOS Software Control Panel + * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) * UPDATE HISTORY: - * 10-19-2007 Created + * 10-19-2007 Created */ -#include "telephon.h" +#include <windows.h> +#include <cpl.h> -#define NUM_APPLETS (1) +#include "resource.h" -LONG CALLBACK SystemApplet(VOID); -HINSTANCE hApplet = 0; -HWND hCPLWindow; - -/* Applets */ - -APPLET Applets[NUM_APPLETS] = -{ - {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} -}; - -/* Property page dialog callback */ -INT_PTR CALLBACK -TelephonPageProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); - - switch (uMsg) - { - case WM_INITDIALOG: - return TRUE; - } - - return FALSE; -} - - - -static VOID -InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) -{ - ZeroMemory(psp, sizeof(PROPSHEETPAGE)); - psp->dwSize = sizeof(PROPSHEETPAGE); - psp->dwFlags = PSP_DEFAULT; - psp->hInstance = hApplet; - psp->pszTemplate = MAKEINTRESOURCE(idDlg); - psp->pfnDlgProc = DlgProc; -} - - -/* First Applet */ -LONG CALLBACK -SystemApplet(VOID) -{ - PROPSHEETPAGE psp[1]; - PROPSHEETHEADER psh; - TCHAR Caption[1024]; - - LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); - - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE; - psh.hwndParent = hCPLWindow; - psh.hInstance = hApplet; - psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); - psh.pszCaption = Caption; - psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); - psh.nStartPage = 0; - psh.ppsp = psp; - psh.pfnCallback = NULL; - - InitPropSheetPage(&psp[0], IDD_PROPPAGE, (DLGPROC)TelephonPageProc); - - return (LONG)(PropertySheet(&psh) != -1); -} - +typedef UINT (CALLBACK* LPINTERNALCONFIG)(HWND, UINT, LPARAM, LPARAM); /* Control Panel Callback */ LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2) { + LPINTERNALCONFIG lpInternalConfig; + HINSTANCE hTapi32; CPLINFO *CPlInfo; - DWORD i; - i = (DWORD)lParam1; switch (uMsg) { case CPL_INIT: return TRUE; case CPL_GETCOUNT: - return NUM_APPLETS; + return 1; case CPL_INQUIRE: CPlInfo = (CPLINFO*)lParam2; CPlInfo->lData = 0; - CPlInfo->idIcon = Applets[i].idIcon; - CPlInfo->idName = Applets[i].idName; - CPlInfo->idInfo = Applets[i].idDescription; + CPlInfo->idIcon = IDI_CPLSYSTEM; + CPlInfo->idName = IDS_CPLSYSTEMNAME; + CPlInfo->idInfo = IDS_CPLSYSTEMDESCRIPTION; break; case CPL_DBLCLK: - hCPLWindow = hwndCPl; - Applets[i].AppletProc(); - break; + { + hTapi32 = LoadLibraryW(L"tapi32.dll"); + if (!hTapi32) return FALSE; + + lpInternalConfig = (LPINTERNALCONFIG) GetProcAddress(hTapi32, "internalConfig"); + if (!lpInternalConfig) return FALSE; + + lpInternalConfig(hwndCPl, 0, 0, 0); + return TRUE; + } } return FALSE; } - BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved) { - UNREFERENCED_PARAMETER(lpvReserved); - - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - CoInitialize(NULL); - hApplet = hinstDLL; - break; - } - return TRUE; } Removed: trunk/reactos/dll/cpl/telephon/telephon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/telephon/telephon.…
============================================================================== --- trunk/reactos/dll/cpl/telephon/telephon.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/telephon/telephon.h (removed) @@ -1,32 +1,0 @@ -#ifndef __CPL_TELEPHON_H -#define __CPL_TELEPHON_H - -#include <windows.h> -#include <commctrl.h> -#include <cpl.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> -#include <process.h> - -#include "resource.h" - -typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID); - -typedef struct -{ - int idIcon; - int idName; - int idDescription; - CPLAPPLET_PROC AppletProc; -} APPLET, *PAPPLET; - - -extern HINSTANCE hApplet; - -void ShowLastWin32Error(HWND hWndOwner); - -#endif /* __CPL_TELEPHON_H */ - -/* EOF */
15 years, 11 months
1
0
0
0
[dgoette] 39086: * simplify Smarty Filter backend * show title in entry table again * make preview working again, now don't open a new window per preview, load into an iframe instaed * use vertical written text in admin tables, to get an better overview * use revision copy function only to build new translations * make admin functions working again, after that ACL & APL changes * fix a bug in generator: while updating entries, entries where generated too often * minor bugfixes * simple style cha
by dgoette@svn.reactos.org
Author: dgoette Date: Sun Jan 25 05:25:18 2009 New Revision: 39086 URL:
http://svn.reactos.org/svn/reactos?rev=39086&view=rev
Log: * simplify Smarty Filter backend * show title in entry table again * make preview working again, now don't open a new window per preview, load into an iframe instaed * use vertical written text in admin tables, to get an better overview * use revision copy function only to build new translations * make admin functions working again, after that ACL & APL changes * fix a bug in generator: while updating entries, entries where generated too often * minor bugfixes * simple style changes Added:
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsitePreview.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Presentation.class.php
Modified:
branches/danny-web/reactos.org/htdocs/roscms/config.php
branches/danny-web/reactos.org/htdocs/roscms/connect.db.php
branches/danny-web/reactos.org/htdocs/roscms/css/user.css
branches/danny-web/reactos.org/htdocs/roscms/index.php
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_ACL.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_Groups.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_System.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteFilter.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteLabel.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_Page.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_XML.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Generate.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/Tag.class.php
Modified:
branches/danny-web/reactos.org/htdocs/roscms/config.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/config.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/config.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +// How much debug by php itself should be showed +error_reporting(E_ALL); +ini_set('error_reporting', E_ALL); if (!defined('ROSCMS_PATH')) { define('ROSCMS_PATH',''); // relative path to roscms Modified:
branches/danny-web/reactos.org/htdocs/roscms/connect.db.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/connect.db.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/connect.db.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -26,5 +26,6 @@ $db_name = 'roscms'; // vars are unset in DBConnection class +// !!! so be sure to use DBConnection or unset(..) yourself ?> Modified:
branches/danny-web/reactos.org/htdocs/roscms/css/user.css
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/css/user.css
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/css/user.css
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -26,7 +26,7 @@ /* left menu */ #leftNav { padding: 0px 10px 10px 10px; } #leftNav UL { margin: 0px 0px 1.5em 0px; padding: 0px; list-style-type: none; background-color: #EEEEEE; border-top: #3F3849 0px solid; border-right: #3F3849 1px solid; border-left: #3F3849 1px solid; } -#leftNav UL LI { font-size: 13px; font-weight: bold; border-bottom: 1px solid #3f3849; } +#leftNav UL LI { font-size: 12px; font-weight: bold; border-bottom: 1px solid #3f3849; } #leftNav UL LI A { display: block; padding: 2px 4px; color: #3F3849; text-decoration: none; } #leftNav UL LI A:hover { color: black; background-color: #FFCC33; } #leftNav H2 { margin: 0px; padding-left: 12px; border: #3F3849 1px solid; font-weight: bold; font-size: 14px; color: white; background-color: #5984c3; } Modified:
branches/danny-web/reactos.org/htdocs/roscms/index.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/index.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/index.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -3,7 +3,7 @@ RosCMS - ReactOS Content Management System Copyright (C) 2005-2008 Klemens Friedl <frik85(a)reactos.org> 2005 Ge van Geldorp <gvg(a)reactos.org> - 2008 Danny Götte <dangerground(a)web.de> + 2008-2009 Danny Götte <dangerground(a)web.de> 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 @@ -19,10 +19,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -//@MOVEME to config -error_reporting(E_ALL); -ini_set('error_reporting', E_ALL); if (get_magic_quotes_gpc()) { ini_set('magic_quotes', 'off'); @@ -146,6 +142,9 @@ case 'uqi': // User Quick Info new Export_QuickInfo(); break; + case 'prv': // Preview + new CMSWebsitePreview(); + break; default: die(''); break; @@ -180,8 +179,16 @@ break; } // end $_GET['d_u'] break; - break; } // end switch + break; + + // presentation + case 'presentation': + switch ($_GET['type']) { + case 'vtext': // vertical text + Presentation::verticalText($_GET['text']); + break; + } // end type break; // No permission Modified:
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/js/cms_website.js
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -442,7 +442,7 @@ } if (uf_name != '' && uf_name.length < 50) { - makeRequest('?page=data_out&d_f=text&d_u=ufs&d_val=add&d_val2='+encodeURIComponent(uf_type)+'&d_val3='+encodeURIComponent(uf_name)+'&d_val4='+encodeURIComponent(uf_str), 'ufs', uf_objid, 'html', 'GET', ''); + makeRequest('?page=data_out&d_f=text&d_u=ufs&action=add&title='+encodeURIComponent(uf_name)+'&setting='+encodeURIComponent(uf_str), 'ufs', uf_objid, 'html', 'GET', ''); } } @@ -461,7 +461,7 @@ uf_objid = 'labtitel2c'; if (uf_check == true) { - makeRequest('?page=data_out&d_f=text&d_u=ufs&d_val=del&d_val2='+encodeURIComponent(uf_type)+'&d_val3='+encodeURIComponent(uf_id), 'ufs', uf_objid, 'html', 'GET', ''); + makeRequest('?page=data_out&d_f=text&d_u=ufs&action=del&id='+encodeURIComponent(uf_id), 'ufs', uf_objid, 'html', 'GET', ''); } } @@ -685,6 +685,7 @@ if (document.getElementById('frametable').style.display != 'block') { document.getElementById('frametable').style.display = 'block'; document.getElementById('frameedit').style.display = 'none'; + document.getElementById('previewarea').style.display = 'none'; // deactivate alert-timer window.clearTimeout(alertactiv); @@ -778,6 +779,7 @@ if (document.getElementById('frametable').style.display != 'block') { document.getElementById('frametable').style.display = 'block'; document.getElementById('frameedit').style.display = 'none'; + document.getElementById('previewarea').style.display = 'none'; } reloadEntryTableWithOffset( offset ); @@ -793,6 +795,7 @@ if (document.getElementById('frametable').style.display != 'block') { document.getElementById('frametable').style.display = 'block'; document.getElementById('frameedit').style.display = 'none'; + document.getElementById('previewarea').style.display = 'none'; } // deactivate alert-timer @@ -815,6 +818,7 @@ { if (document.getElementById('frameedit').style.display != 'block') { document.getElementById('frametable').style.display = 'none'; + document.getElementById('previewarea').style.display = 'none'; document.getElementById('frameedit').style.display = 'block'; } @@ -876,7 +880,7 @@ roscms_prev_page = roscms_current_page; roscms_current_page = objevent; - document.getElementById('frmedithead').innerHTML = '<span class="button" onclick="loadEntryTableWithOffset(roscms_current_tbl_position)"><strong>« Back</strong></span> <b>Edit Entry</b>'; + document.getElementById('frmedithead').innerHTML = '<span class="button" onclick="loadEntryTableWithOffset(roscms_current_tbl_position)"><strong>« Back</strong></span> <strong>Edit Entry</strong>'; // enable autosave autosave_timer = window.setTimeout("tryAutosave()", autosave_coundown); @@ -1787,6 +1791,11 @@ // user quick info case 'uqi': updateQuickinfo(http_request, objid); + break; + + // preview + case 'prv': + showPreview(http_request, objid); break; default: @@ -2378,13 +2387,31 @@ var tentrs2 = tentrs[1].split("_"); if (tentrs[0] == 1) { - window.open(roscms_intern_page_link+"data_out&d_f=page&d_u=show&d_val="+tentrs2[1]+"&d_val2="+userlang+"&d_val3=", "RosCMSPagePreview"); + makeRequest('?page=data_out&d_f=text&d_u=prv&rev_id='+tentrs2[1], 'prv', 'previewarea', 'html', 'GET', ''); } else { alertbox("Select one entry to preview a page!"); } - - document.getElementById('extraopt').value = 'sel'; +} + + + +/** + * put the previewed page into an iframe and hide other elements like entry table and editor + * + * @param object http_request + * @param string objid + */ +function showPreview( http_request, objid ) +{ + if (document.getElementById('previewarea').style.display != 'block') { + document.getElementById('frametable').style.display = 'none'; + document.getElementById('frameedit').style.display = 'none'; + document.getElementById('previewarea').style.display = 'block'; + } + + document.getElementById('previewzone').innerHTML = http_request.responseText; + document.getElementById('previewhead').innerHTML = '<span class="button" onclick="loadEntryTableWithOffset(roscms_current_tbl_position)"><strong>« Back</strong></span> <strong>Preview</strong>'; } Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_ACL.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_ACL.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_ACL.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -35,21 +35,25 @@ */ protected function showNew( ) { + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_RIGHTS." ORDER BY name ASC"); + $stmt->execute(); + $rights=$stmt->fetchAll(PDO::FETCH_ASSOC); + echo_strip(' <h2>Create new Access Control List (ACL)</h2> <form onsubmit="return false;"> <fieldset> <legend>Access Control List Options</legend> - <label for="acl_name">Name</label> - <input id="acl_name" name="acl_name" maxlength="100" value="" /> + <label for="access_name">Name</label> + <input id="access_name" name="access_name" maxlength="100" value="" /> <br /> - <label for="acl_short">Short Name (Identifier)</label> - <input id="acl_short" name="acl_short" maxlength="50" value="" /> + <label for="access_short">Short Name (Identifier)</label> + <input id="access_short" name="access_short" maxlength="50" value="" /> <br /> - <label for="acl_desc">Description</label> - <input id="acl_desc" name="acl_desc" maxlength="255" value="" /> + <label for="access_desc">Description</label> + <input id="access_desc" name="access_desc" maxlength="255" value="" /> </fieldset> <br /> <fieldset> @@ -57,14 +61,11 @@ <table> <tr> <th title="Security Level">SecLvl</th> - <th>Group Name</th> - <th title="read">R</th> - <th title="write">W</th> - <th title="add">A</th> - <th title="delete">D</th> - <th title="publish">P</th> - <th title="translate">T</th> - </tr>'); + <th>Group Name</th>'); + foreach ($rights as $right) { + echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="?page=presentation&type=vtext&text='.$right['name'].'" alt="'.$right['name'].'" /></th>'; + } + echo '</tr>'; $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, security_level, description FROM ".ROSCMST_GROUPS." ORDER BY security_level ASC, name ASC"); $stmt->execute(); @@ -72,14 +73,12 @@ echo_strip(' <tr title="'.htmlspecialchars($group['description']).'"> <td>'.$group['security_level'].'</td> - <td>'.htmlspecialchars($group['name']).'</td> - <td title="read entries"><input type="checkbox" name="read'.$group['id'].'" id="read'.$group['id'].'" checked="checked" value="1" /></td> - <td title="edit entries"><input type="checkbox" name="write'.$group['id'].'" id="write'.$group['id'].'" value="1" /></td> - <td title="add new entries"><input type="checkbox" name="add'.$group['id'].'" id="add'.$group['id'].'" value="1" /></td> - <td title="delete entries"><input type="checkbox" name="del'.$group['id'].'" id="del'.$group['id'].'" value="1" /></td> - <td title="make entries stable"><input type="checkbox" name="pub'.$group['id'].'" id="pub'.$group['id'].'" value="1" /></td> - <td title="translate entries"><input type="checkbox" name="trans'.$group['id'].'" id="trans'.$group['id'].'" value="1" /></td> - </tr>'); + <td>'.htmlspecialchars($group['name']).'</td>'); + + foreach ($rights as $right) { + echo '<td title="'.$group['name'].'--'.$right['name'].': '.$right['description'].'"><input type="checkbox" value="1" name="valid'.$group['id'].'_'.$right['id'].'" /></td>'; + } + echo '</tr>'; } echo_strip(' @@ -103,35 +102,35 @@ // try to insert new access list $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ACCESS." (name, name_short, description) VALUES (:name, :short, :description)"); - $stmt->bindParam('name',$_POST['acl_name'],PDO::PARAM_STR); - $stmt->bindParam('short',$_POST['acl_short'],PDO::PARAM_STR); - $stmt->bindParam('description',$_POST['acl_desc'],PDO::PARAM_STR); + $stmt->bindParam('name',$_POST['access_name'],PDO::PARAM_STR); + $stmt->bindParam('short',$_POST['access_short'],PDO::PARAM_STR); + $stmt->bindParam('description',$_POST['access_desc'],PDO::PARAM_STR); if ($stmt->execute()) { // check for new access list id $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_ACCESS." WHERE name=:name"); - $stmt->bindParam('name',$_POST['acl_name'],PDO::PARAM_STR); + $stmt->bindParam('name',$_POST['access_name'],PDO::PARAM_STR); $stmt->execute(); $access_id = $stmt->fetchColumn(); if ($access_id !== false) { - // prepare for usage in loop - $stmt_ins=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ENTRY_AREA." (acl_id, group_id, can_read, can_write, can_add, can_delete, can_publish, can_translate) VALUES (:acl_id, :group_id, :read, :write, :add, :delete, :publish, :translate)"); - $stmt_ins->bindParam('acl_id',$access_id,PDO::PARAM_INT); - - // insert access rights for each group - $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_GROUPS); + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_RIGHTS." ORDER BY name ASC"); $stmt->execute(); - while ($group = $stmt->fetch(PDO::FETCH_ASSOC)) { - $stmt_ins->bindParam('group_id',$group['id'],PDO::PARAM_INT); - $stmt_ins->bindValue('read',$_POST['read'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('write',$_POST['write'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('add',$_POST['add'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('delete',$_POST['del'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('publish',$_POST['pub'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('translate',$_POST['trans'.$group['id']]=='true',PDO::PARAM_BOOL); - $success = $success && $stmt_ins->execute(); - } + $rights=$stmt->fetchAll(PDO::FETCH_ASSOC); + + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ACL." (access_id, group_id, right_id) VALUES (:access_id,:group_id,:right_id)"); + $stmt->bindParam('access_id',$access_id,PDO::PARAM_INT); + foreach ($_POST as $item=>$val) { + if (strpos($item,'valid')===0) { + $item = substr($item, 5); + $id = explode('_',$item); + if($id[0] > 0 && $id[1] > 0 && $val=='true') { + $stmt->bindParam('right_id',$id[1],PDO::PARAM_INT); + $stmt->bindParam('group_id',$id[0],PDO::PARAM_INT); + $success = $success && $stmt->execute(); + } + } + } // end foreach } // end got list id else { $success = false; @@ -162,7 +161,7 @@ echo_strip(' <h2>Select ACL to '.($_GET['for']=='edit' ? 'edit' : 'delete').'</h2> <form onsubmit="return false;"> - <select name="acl" id="acl"> + <select name="access" id="access"> <option value="0"> </option>'); $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_ACCESS." ORDER BY name ASC"); @@ -187,7 +186,7 @@ protected function submitSearch( ) { // show edit / delete form, if entry was selected - if ($_POST['acl'] > 0) { + if ($_POST['access'] > 0) { if ($_GET['for'] == 'edit') { self::showEdit(); } @@ -211,8 +210,12 @@ */ protected function showEdit( ) { - $stmt=&DBConnection::getInstance()->prepare("SELECT name, name_short, description, id FROM ".ROSCMST_ACCESS." WHERE id=:acl_id"); - $stmt->bindParam('acl_id',$_POST['acl'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_RIGHTS." ORDER BY name ASC"); + $stmt->execute(); + $rights=$stmt->fetchAll(PDO::FETCH_ASSOC); + + $stmt=&DBConnection::getInstance()->prepare("SELECT name, name_short, description, id FROM ".ROSCMST_ACCESS." WHERE id=:access_id"); + $stmt->bindParam('access_id',$_POST['access'],PDO::PARAM_INT); $stmt->execute(); $access = $stmt->fetchOnce(PDO::FETCH_ASSOC); @@ -221,18 +224,18 @@ <form onsubmit="return false;"> <fieldset> <legend>Access Control List Options</legend> - <input type="hidden" name="acl_id" id="acl_id" value="'.$access['id'].'" /> + <input type="hidden" name="access_id" id="access_id" value="'.$access['id'].'" /> - <label for="acl_name">Name</label> - <input id="acl_name" name="acl_name" maxlength="100" value="'.$access['name'].'" /> + <label for="access_name">Name</label> + <input id="access_name" name="access_name" maxlength="100" value="'.$access['name'].'" /> <br /> - <label for="acl_short">Short Name (Identifier)</label> - <input id="acl_short" name="acl_short" maxlength="50" value="'.$access['name_short'].'" /> + <label for="access_short">Short Name (Identifier)</label> + <input id="access_short" name="access_short" maxlength="50" value="'.$access['name_short'].'" /> <br /> - <label for="acl_desc">Description</label> - <input id="acl_desc" name="acl_desc" maxlength="255" value="'.$access['description'].'" /> + <label for="access_desc">Description</label> + <input id="access_desc" name="access_desc" maxlength="255" value="'.$access['description'].'" /> </fieldset> <br /> <fieldset> @@ -240,30 +243,33 @@ <table> <tr> <th title="Security Level">SecLvl</th> - <th>Group Name</th> - <th title="read">R</th> - <th title="write">W</th> - <th title="add">A</th> - <th title="delete">D</th> - <th title="publish">P</th> - <th title="translate">T</th> - </tr>'); - - $stmt=&DBConnection::getInstance()->prepare("SELECT g.id, g.name, g.security_level, g.description, a.can_read, a.can_write, a.can_add, a.can_delete, a.can_publish, a.can_translate FROM ".ROSCMST_ENTRY_AREA." a JOIN ".ROSCMST_GROUPS." g ON g.id=a.group_id WHERE a.acl_id=:acl_id ORDER BY g.security_level ASC, g.name ASC"); - $stmt->bindParam('acl_id',$access['id'],PDO::PARAM_INT); + <th>Group Name</th>'); + foreach ($rights as $right) { + echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="?page=presentation&type=vtext&text='.$right['name'].'" alt="'.$right['name'].'" /></th>'; + } + echo '</tr>'; + + + // for usage in loop + $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_ACL." WHERE group_id=:group_id AND right_id=:right_id AND access_id=:access_id LIMIT 1"); + $stmt_is->bindParam('access_id',$access['id'],PDO::PARAM_INT); + + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, security_level, description FROM ".ROSCMST_GROUPS." ORDER BY security_level ASC, name ASC"); $stmt->execute(); while ($group = $stmt->fetch(PDO::FETCH_ASSOC)) { + $stmt_is->bindParam('group_id',$group['id'],PDO::PARAM_INT); echo_strip(' <tr title="'.htmlspecialchars($group['description']).'"> <td>'.$group['security_level'].'</td> - <td>'.htmlspecialchars($group['name']).'</td> - <td title="read entries"><input type="checkbox" name="read'.$group['id'].'" id="read'.$group['id'].'" '.($group['can_read'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="edit entries"><input type="checkbox" name="write'.$group['id'].'" id="write'.$group['id'].'" '.($group['can_write'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="add new entries"><input type="checkbox" name="add'.$group['id'].'" id="add'.$group['id'].'" '.($group['can_add'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="delete entries"><input type="checkbox" name="del'.$group['id'].'" id="del'.$group['id'].'" '.($group['can_delete'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="make entries stable"><input type="checkbox" name="pub'.$group['id'].'" id="pub'.$group['id'].'" '.($group['can_publish'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="translate entries"><input type="checkbox" name="trans'.$group['id'].'" id="trans'.$group['id'].'" '.($group['can_translate'] == true ? 'checked="checked"' : '').' value="1" /></td> - </tr>'); + <td>'.htmlspecialchars($group['name']).'</td>'); + foreach ($rights as $right) { + $stmt_is->bindParam('right_id',$right['id'],PDO::PARAM_INT); + $stmt_is->execute(); + $is = $stmt_is->fetchColumn(); + + echo '<td title="'.$group['name'].'--'.$right['name'].': '.$right['description'].'"><input type="checkbox" value="1" name="valid'.$group['id'].'_'.$right['id'].'" '.($is ? 'checked="checked"' : '').' /></td>'; + } + echo '</tr>'; } echo_strip(' @@ -286,29 +292,31 @@ $success = true; // try to insert new access list - $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_ACCESS." SET name=:name, name_short=:short, description=:description WHERE id=:acl_id"); - $stmt->bindParam('name',$_POST['acl_name'],PDO::PARAM_STR); - $stmt->bindParam('short',$_POST['acl_short'],PDO::PARAM_STR); - $stmt->bindParam('description',$_POST['acl_desc'],PDO::PARAM_STR); - $stmt->bindParam('acl_id',$_POST['acl_id'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_ACCESS." SET name=:name, name_short=:short, description=:description WHERE id=:access_id"); + $stmt->bindParam('name',$_POST['access_name'],PDO::PARAM_STR); + $stmt->bindParam('short',$_POST['access_short'],PDO::PARAM_STR); + $stmt->bindParam('description',$_POST['access_desc'],PDO::PARAM_STR); + $stmt->bindParam('access_id',$_POST['access_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); - // prepare for usage in loop - $stmt_ins=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_ENTRY_AREA." SET can_read=:read, can_write=:write, can_add=:add, can_delete=:delete, can_publish=:publish, can_translate=:translate WHERE acl_id=:acl_id AND group_id=:group_id"); - $stmt_ins->bindParam('acl_id',$_POST['acl_id'],PDO::PARAM_INT); - - // insert access rights for each group - $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_GROUPS); + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACL." WHERE access_id=:access_id"); + $stmt->bindParam('access_id',$_POST['access_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); - while ($group = $stmt->fetch(PDO::FETCH_ASSOC)) { - $stmt_ins->bindParam('group_id',$group['id'],PDO::PARAM_INT); - $stmt_ins->bindValue('read',$_POST['read'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('write',$_POST['write'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('add',$_POST['add'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('delete',$_POST['del'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('publish',$_POST['pub'.$group['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('translate',$_POST['trans'.$group['id']]=='true',PDO::PARAM_BOOL); - $success = $success && $stmt_ins->execute(); + + if ($success) { + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ACL." (access_id, group_id, right_id) VALUES (:access_id,:group_id,:right_id)"); + $stmt->bindParam('access_id',$_POST['access_id'],PDO::PARAM_INT); + foreach ($_POST as $item=>$val) { + if (strpos($item,'valid')===0) { + $item = substr($item, 5); + $id = explode('_',$item); + if($id[0] > 0 && $id[1] > 0 && $val=='true') { + $stmt->bindParam('right_id',$id[1],PDO::PARAM_INT); + $stmt->bindParam('group_id',$id[0],PDO::PARAM_INT); + $success = $success && $stmt->execute(); + } + } + } } // give the user a success or failure message @@ -329,8 +337,8 @@ */ protected function showDelete( ) { - $stmt=&DBConnection::getInstance()->prepare("SELECT COUNT(id) FROM ".ROSCMST_ENTRIES." WHERE acl_id=:acl_id"); - $stmt->bindParam('acl_id',$_POST['acl'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("SELECT COUNT(id) FROM ".ROSCMST_ENTRIES." WHERE access_id=:access_id"); + $stmt->bindParam('access_id',$_POST['access'],PDO::PARAM_INT); $stmt->execute(); $data_count = $stmt->fetchColumn(); @@ -339,17 +347,17 @@ echo '<div>Can\'t delete entry: It\'s used in '.$data_count.' entries. Remove usage first, and try again later.</div>'; } else { - $stmt=&DBConnection::getInstance()->prepare("SELECT name, name_short, description, id FROM ".ROSCMST_ACCESS." WHERE id=:acl_id"); - $stmt->bindParam('acl_id',$_POST['acl'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("SELECT name, name_short, description, id FROM ".ROSCMST_ACCESS." WHERE id=:access_id"); + $stmt->bindParam('access_id',$_POST['access'],PDO::PARAM_INT); $stmt->execute(); $access = $stmt->fetchOnce(PDO::FETCH_ASSOC); echo_strip(' <form onsubmit="return false;"> <div> - <input type="hidden" name="acl_id" id="acl_id" value="'.$access['id'].'" /> - - Do you really want to delete the ACL "<span title="'.$access['description'].'">'.$access['name'].'</span>" ? + <input type="hidden" name="access_id" id="access_id" value="'.$access['id'].'" /> + + Do you really want to delete the access "<span title="'.$access['description'].'">'.$access['name'].'</span>" ? <button style="color: red;" onclick="'."submitDelete('acl')".'" name="uaq" value="yes">Yes, Delete it.</button> <button style="color: green;" name="uaq" value="no">No</button> </div> @@ -369,8 +377,8 @@ $success = true; // check if it is used anywhere - $stmt=&DBConnection::getInstance()->prepare("SELECT COUNT(id) FROM ".ROSCMST_ENTRIES." WHERE acl_id=:acl_id"); - $stmt->bindParam('acl_id',$_POST['acl_id'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("SELECT COUNT(id) FROM ".ROSCMST_ENTRIES." WHERE access_id=:access_id"); + $stmt->bindParam('access_id',$_POST['access_id'],PDO::PARAM_INT); $stmt->execute(); $data_count = $stmt->fetchColumn(); if ($data_count > 0) { @@ -379,14 +387,14 @@ else { // delete acl - $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACCESS." WHERE id=:acl_id"); - $stmt->bindParam('acl_id',$_POST['acl_id'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACCESS." WHERE id=:access_id"); + $stmt->bindParam('access_id',$_POST['access_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); // delete rights list if ($success) { - $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ENTRY_AREA." WHERE acl_id=:acl_id"); - $stmt->bindParam('acl_id',$_POST['acl_id'],PDO::PARAM_INT); + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACL." WHERE access_id=:access_id"); + $stmt->bindParam('access_id',$_POST['access_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); } Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_Groups.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_Groups.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_Groups.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -35,6 +35,10 @@ */ protected function showNew( ) { + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_RIGHTS." ORDER BY name ASC"); + $stmt->execute(); + $rights=$stmt->fetchAll(PDO::FETCH_ASSOC); + echo_strip(' <h2>Create new Group</h2> <form onsubmit="return false;"> @@ -42,10 +46,10 @@ <legend>Group Data</legend> <label for="group_sec">Security Level</label> <select id="group_sec" name="group_sec"> - <option value="0">0 (no access to CMS, only that myRosCMS stuff)</option> - <option value="1">1 (simple users (e.g. translator))</option> - <option value="2">2 (advanced rights, e.g. developers)</option> - <option value="3">3 (some admin functions)</option> + <option value="0">0</option> + <option value="1">1</option> + <option value="2">2</option> + <option value="3">3</option> </select> <br /> @@ -65,32 +69,47 @@ <legend>configure group access rights</legend> <table> <tr> + <th>ACL Name</th>'); + foreach ($rights as $right) { + echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="?page=presentation&type=vtext&text='.$right['name'].'" alt="'.$right['name'].'" /></th>'; + } + echo '</tr>'; + + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_ACCESS." ORDER BY name ASC"); + $stmt->execute(); + while ($access = $stmt->fetch(PDO::FETCH_ASSOC)) { + echo_strip(' + <tr title="'.htmlspecialchars($access['description']).'"> + <td>'.htmlspecialchars($access['name']).'</td>'); + + foreach ($rights as $right) { + echo '<td title="'.$access['name'].'--'.$access['name'].': '.$access['description'].'"><input type="checkbox" value="1" name="valid'.$access['id'].'_'.$right['id'].'" /></td>'; + } + echo '</tr>'; + } + + echo_strip(' + </table> + </fieldset> + <br /> + <fieldset> + <legend>Area Protection List (APL)</legend> + <table> + <tr> <th>ACL Name</th> - <th title="read">R</th> - <th title="write">W</th> - <th title="add">A</th> - <th title="delete">D</th> - <th title="publish">P</th> - <th title="translate">T</th> - </tr>'); - - $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_ACCESS." ORDER BY name ASC"); - $stmt->execute(); - while ($acl = $stmt->fetch(PDO::FETCH_ASSOC)) { + <th>Status</th>'); + + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_AREA." ORDER BY name ASC"); + $stmt->execute(); + while ($area = $stmt->fetch(PDO::FETCH_ASSOC)) { echo_strip(' - <tr title="'.htmlspecialchars($acl['description']).'"> - <td>'.htmlspecialchars($acl['name']).'</td> - <td title="read entries"><input type="checkbox" name="read'.$acl['id'].'" id="read'.$acl['id'].'" value="1" /></td> - <td title="edit entries"><input type="checkbox" name="write'.$acl['id'].'" id="write'.$acl['id'].'" value="1" /></td> - <td title="add new entries"><input type="checkbox" name="add'.$acl['id'].'" id="add'.$acl['id'].'" value="1" /></td> - <td title="delete entries"><input type="checkbox" name="del'.$acl['id'].'" id="del'.$acl['id'].'" value="1" /></td> - <td title="make entries stable"><input type="checkbox" name="pub'.$acl['id'].'" id="pub'.$acl['id'].'" value="1" /></td> - <td title="translate entries"><input type="checkbox" name="trans'.$acl['id'].'" id="trans'.$acl['id'].'" value="1" /></td> + <tr> + <td title="'.$area['description'].'"><label for="area'.$area['id'].'">'.$area['name'].'</label></td> + <td><input type="checkbox" value="1" name="area'.$area['id'].'" id="area'.$area['id'].'" /></td> </tr>'); } echo_strip(' - </table> </fieldset> <button onclick="'."submitNew('group')".'">Create new Group</button> </form> @@ -123,23 +142,36 @@ $group_id = $stmt->fetchColumn(); if ($group_id !== false) { - // prepare for usage in loop - $stmt_ins=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ENTRY_AREA." (acl_id, group_id, can_read, can_write, can_add, can_delete, can_publish, can_translate) VALUES (:acl_id, :group_id, :read, :write, :add, :delete, :publish, :translate)"); - $stmt_ins->bindParam('group_id',$group_id,PDO::PARAM_INT); - - // insert access rights for each group - $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_ACCESS); + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_RIGHTS." ORDER BY name ASC"); $stmt->execute(); - while ($acl = $stmt->fetch(PDO::FETCH_ASSOC)) { - $stmt_ins->bindParam('acl_id',$acl['id'],PDO::PARAM_INT); - $stmt_ins->bindValue('read',$_POST['read'.$acl['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('write',$_POST['write'.$acl['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('add',$_POST['add'.$acl['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('delete',$_POST['del'.$acl['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('publish',$_POST['pub'.$acl['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('translate',$_POST['trans'.$acl['id']]=='true',PDO::PARAM_BOOL); - $success = $success && $stmt_ins->execute(); - } + $rights=$stmt->fetchAll(PDO::FETCH_ASSOC); + + $stmt_acl=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ACL." (access_id, group_id, right_id) VALUES (:access_id,:group_id,:right_id)"); + $stmt_acl->bindParam('group_id',$group_id,PDO::PARAM_INT); + $stmt_apl=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_AREA_ACCESS." (area_id, group_id) VALUES (:area_id,:group_id)"); + $stmt_apl->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); + foreach ($_POST as $item=>$val) { + + // insert ACL + if (strpos($item,'valid')===0) { + $item = substr($item, 5); + $id = explode('_',$item); + if($id[0] > 0 && $id[1] > 0 && $val=='true') { + $stmt_acl->bindParam('right_id',$id[1],PDO::PARAM_INT); + $stmt_acl->bindParam('access_id',$id[0],PDO::PARAM_INT); + $success = $success && $stmt_acl->execute(); + } + } + + // insert APL + elseif (strpos($item,'area')===0 && $val=='true') { + $id = substr($item, 4); + if($id > 0) { + $stmt_apl->bindParam('area_id',$id,PDO::PARAM_INT); + $success = $success && $stmt_apl->execute(); + } + } + } // end foreach } // end got list id else { $success = false; @@ -219,6 +251,10 @@ */ protected function showEdit( ) { + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_RIGHTS." ORDER BY name ASC"); + $stmt->execute(); + $rights=$stmt->fetchAll(PDO::FETCH_ASSOC); + $stmt=&DBConnection::getInstance()->prepare("SELECT name, name_short, description, id, security_level FROM ".ROSCMST_GROUPS." WHERE id=:acl_id"); $stmt->bindParam('acl_id',$_POST['group'],PDO::PARAM_INT); $stmt->execute(); @@ -233,10 +269,10 @@ <label for="group_sec">Security Level</label> <select id="group_sec" name="group_sec"> - <option value="0"'.($group['security_level'] == 0 ? ' selected="selected"' : '').'>0 (no access to CMS, only that myRosCMS stuff)</option> - <option value="1"'.($group['security_level'] == 1 ? ' selected="selected"' : '').'>1 (simple users (e.g. translator))</option> - <option value="2"'.($group['security_level'] == 2 ? ' selected="selected"' : '').'>2 (advanced rights, e.g. developers)</option> - <option value="3"'.($group['security_level'] == 3 ? ' selected="selected"' : '').'>3 (some admin functions)</option> + <option value="0"'.($group['security_level'] == 0 ? ' selected="selected"' : '').'>0</option> + <option value="1"'.($group['security_level'] == 1 ? ' selected="selected"' : '').'>1</option> + <option value="2"'.($group['security_level'] == 2 ? ' selected="selected"' : '').'>2</option> + <option value="3"'.($group['security_level'] == 3 ? ' selected="selected"' : '').'>3</option> </select> <br /> @@ -256,33 +292,63 @@ <legend>configure group access rights</legend> <table> <tr> + <th>ACL Name</th>'); + foreach ($rights as $right) { + echo '<th style="vertical-align:bottom;" title="'.$right['name'].': '.$right['description'].'"><img src="?page=presentation&type=vtext&text='.$right['name'].'" alt="'.$right['name'].'" /></th>'; + } + echo '</tr>'; + + // for usage in loop + $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_ACL." WHERE group_id=:group_id AND right_id=:right_id AND access_id=:access_id LIMIT 1"); + $stmt_is->bindParam('group_id',$group['id'],PDO::PARAM_INT); + + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_ACCESS." ORDER BY name ASC"); + $stmt->execute(); + while ($access = $stmt->fetch(PDO::FETCH_ASSOC)) { + $stmt_is->bindParam('access_id',$access['id'],PDO::PARAM_INT); + echo_strip(' + <tr title="'.htmlspecialchars($access['description']).'"> + <td>'.htmlspecialchars($access['name']).'</td>'); + foreach ($rights as $right) { + $stmt_is->bindParam('right_id',$right['id'],PDO::PARAM_INT); + $stmt_is->execute(); + $is = $stmt_is->fetchColumn(); + + echo '<td title="'.$access['name'].'--'.$right['name'].': '.$right['description'].'"><input type="checkbox" value="1" name="valid'.$access['id'].'_'.$right['id'].'" '.($is ? 'checked="checked"' : '').' /></td>'; + } + echo '</tr>'; + } + + echo_strip(' + </table> + </fieldset> + <br /> + <fieldset> + <legend>Area Protection List (APL)</legend> + <table> + <tr> <th>ACL Name</th> - <th title="read">R</th> - <th title="write">W</th> - <th title="add">A</th> - <th title="delete">D</th> - <th title="publish">P</th> - <th title="translate">T</th> - </tr>'); - - $stmt=&DBConnection::getInstance()->prepare("SELECT s.id, s.name, s.description, a.can_read, a.can_write, a.can_add, a.can_delete, a.can_publish, a.can_translate FROM ".ROSCMST_ACCESS." s JOIN ".ROSCMST_ENTRY_AREA." a ON a.acl_id=s.id WHERE a.group_id=:group_id ORDER BY name ASC"); - $stmt->bindParam('group_id',$group['id'],PDO::PARAM_INT); - $stmt->execute(); - while ($acl = $stmt->fetch(PDO::FETCH_ASSOC)) { + <th>Status</th>'); + + // for usage in loop + $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_AREA_ACCESS." WHERE group_id=:group_id AND area_id=:area_id LIMIT 1"); + $stmt_is->bindParam('group_id',$group['id'],PDO::PARAM_INT); + + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_AREA." ORDER BY name ASC"); + $stmt->execute(); + while ($area = $stmt->fetch(PDO::FETCH_ASSOC)) { + $stmt_is->bindParam('area_id',$area['id'],PDO::PARAM_INT); + $stmt_is->execute(); + $is = $stmt_is->fetchColumn(); + echo_strip(' - <tr title="'.htmlspecialchars($acl['description']).'"> - <td>'.htmlspecialchars($acl['name']).'</td> - <td title="read entries"><input type="checkbox" name="read'.$acl['id'].'" id="read'.$acl['id'].'" '.($acl['can_read'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="edit entries"><input type="checkbox" name="write'.$acl['id'].'" id="write'.$acl['id'].'" '.($acl['can_write'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="add new entries"><input type="checkbox" name="add'.$acl['id'].'" id="add'.$acl['id'].'" '.($acl['can_add'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="delete entries"><input type="checkbox" name="del'.$acl['id'].'" id="del'.$acl['id'].'" '.($acl['can_delete'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="make entries stable"><input type="checkbox" name="pub'.$acl['id'].'" id="pub'.$acl['id'].'" '.($acl['can_publish'] == true ? 'checked="checked"' : '').' value="1" /></td> - <td title="translate entries"><input type="checkbox" name="trans'.$acl['id'].'" id="trans'.$acl['id'].'" '.($acl['can_translate'] == true ? 'checked="checked"' : '').' value="1" /></td> + <tr> + <td title="'.$area['description'].'"><label for="area'.$area['id'].'">'.$area['name'].'</label></td> + <td><input type="checkbox" value="1" name="area'.$area['id'].'" id="area'.$area['id'].'"'.($is ? ' checked="checked"' : '').' /></td> </tr>'); } echo_strip(' - </table> </fieldset> <button onclick="'."submitEdit('group')".'">Edit Group</button> </form> @@ -309,22 +375,41 @@ $stmt->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); - // prepare for usage in loop - $stmt_ins=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_ENTRY_AREA." SET can_read=:read, can_write=:write, can_add=:add, can_delete=:delete, can_publish=:publish, can_translate=:translate WHERE acl_id=:acl_id AND group_id=:group_id"); - $stmt_ins->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); - - // insert access rights for each group - $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_ACCESS); + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACL." WHERE group_id=:group_id"); + $stmt->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); - while ($access = $stmt->fetch(PDO::FETCH_ASSOC)) { - $stmt_ins->bindParam('acl_id',$access['id'],PDO::PARAM_INT); - $stmt_ins->bindValue('read',$_POST['read'.$access['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('write',$_POST['write'.$access['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('add',$_POST['add'.$access['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('delete',$_POST['del'.$access['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('publish',$_POST['pub'.$access['id']]=='true',PDO::PARAM_BOOL); - $stmt_ins->bindValue('translate',$_POST['trans'.$access['id']]=='true',PDO::PARAM_BOOL); - $success = $success && $stmt_ins->execute(); + + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_AREA_ACCESS." WHERE group_id=:group_id"); + $stmt->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); + $success = $success && $stmt->execute(); + + if ($success) { + $stmt_acl=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_ACL." (access_id, group_id, right_id) VALUES (:access_id,:group_id,:right_id)"); + $stmt_acl->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); + $stmt_apl=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_AREA_ACCESS." (area_id, group_id) VALUES (:area_id,:group_id)"); + $stmt_apl->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); + foreach ($_POST as $item=>$val) { + + // insert ACL + if (strpos($item,'valid')===0) { + $item = substr($item, 5); + $id = explode('_',$item); + if($id[0] > 0 && $id[1] > 0 && $val=='true') { + $stmt_acl->bindParam('right_id',$id[1],PDO::PARAM_INT); + $stmt_acl->bindParam('access_id',$id[0],PDO::PARAM_INT); + $success = $success && $stmt_acl->execute(); + } + } + + // insert APL + elseif (strpos($item,'area')===0 && $val=='true') { + $id = substr($item, 4); + if($id > 0) { + $stmt_apl->bindParam('area_id',$id,PDO::PARAM_INT); + $success = $success && $stmt_apl->execute(); + } + } + } } // give the user a success or failure message @@ -380,7 +465,11 @@ // delete rights list if ($success) { - $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ENTRY_AREA." WHERE group_id=:group_id"); + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACL." WHERE group_id=:group_id"); + $stmt->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); + $success = $success && $stmt->execute(); + + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_ACL." WHERE group_id=:group_id"); $stmt->bindParam('group_id',$_POST['group_id'],PDO::PARAM_INT); $success = $success && $stmt->execute(); } Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_System.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_System.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Admin_System.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -74,7 +74,7 @@ */ protected function showAPL( ) { - $stmt=&DBConnection::getInstance()->prepare("SELECT id, name_short, description FROM ".ROSCMST_AREA." ORDER BY name_short ASC"); + $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, description FROM ".ROSCMST_AREA." ORDER BY name ASC"); $stmt->execute(); $areas=$stmt->fetchAll(PDO::FETCH_ASSOC); @@ -88,15 +88,11 @@ <th style="vertical-align:bottom;" title="Security Level">SecLvl</th> <th style="vertical-align:bottom;">Group Name</th>'); foreach ($areas as $area) { - echo '<th style="width: 1em;font-family:monospace;vertical-align:bottom;line-height: 0.8em;" title="'.$area['name_short'].': '.$area['description'].'">'; - for ($i=0; $i<strlen($area['name_short']);$i++) { - echo substr($area['name_short'], $i, 1).'<br />'; - } - echo '</th>'; + echo '<th style="vertical-align:bottom;" title="'.$area['name'].': '.$area['description'].'"><img src="?page=presentation&type=vtext&text='.$area['name'].'" alt="'.$area['name'].'" /></th>'; } echo '</tr>'; - $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_AREA." a JOIN ".ROSCMST_AREA_ACCESS." b ON a.id=b.area_id WHERE b.group_id=:group_id AND a.id=:area_id ORDER BY a.name_short LIMIT 1"); + $stmt_is=&DBConnection::getInstance()->prepare("SELECT TRUE FROM ".ROSCMST_AREA." a JOIN ".ROSCMST_AREA_ACCESS." b ON a.id=b.area_id WHERE b.group_id=:group_id AND a.id=:area_id LIMIT 1"); $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, security_level, description FROM ".ROSCMST_GROUPS." ORDER BY security_level ASC, name ASC"); $stmt->execute(); @@ -111,7 +107,7 @@ $stmt_is->execute(); $is = $stmt_is->fetchColumn(); - echo '<td title="'.$group['name'].'--'.$area['name_short'].': '.$area['description'].'"><input type="checkbox" value="1" name="valid'.$group['id'].'_'.$area['id'].'" '.($is ? 'checked="checked"' : '').' /></td>'; + echo '<td title="'.$group['name'].'--'.$area['name'].': '.$area['description'].'"><input type="checkbox" value="1" name="valid'.$group['id'].'_'.$area['id'].'" '.($is ? 'checked="checked"' : '').' /></td>'; } echo '</tr>'; } Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteFilter.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteFilter.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteFilter.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -25,59 +25,85 @@ class CMSWebsiteFilter { - private $type_num = 1; - public function __construct( ) { Login::required(); - $this->manage(); + // manage actions for adding / deleting filters + if ($_GET['d_val'] == 'add') { + $this->add($_GET['title'], $_GET['setting']); + } + elseif ($_GET['d_val'] == 'del') { + $this->del($_GET['id']); + } + + // show updated filter list + $this->show(); + } // end of member function __construct + /** - * cares about filter management: adding, deleting, listing + * adds a new filter to users smart filters * - * @param string _GET['d_value'] action 'add' or 'del' - * @param string _GET['d_value3'] filter_title if adding its the filter name, if del it's the filter id - * @param string _GET['d_value4'] filter_string filter content + * @param string title the filter name + * @param string setting filter settings * @return * @access private */ - private function manage( ) + private function add( $title, $setting ) { $thisuser = &ThisUser::getInstance(); - // add a new label - if ($_GET['d_val'] == 'add') { + // check if filter already exists + $stmt=&DBConnection::getInstance()->prepare("SELECT 1 FROM ".ROSCMST_FILTER." WHERE user_id = :user_id AND name = :title LIMIT 1"); + $stmt->bindParam('user_id',$thisuser->id(),PDO::PARAM_INT); + $stmt->bindParam('title',$title,PDO::PARAM_STR); + $stmt->execute(); + if ($stmt->fetchColumn() === false) { - // check if filter already exists - $stmt=&DBConnection::getInstance()->prepare("SELECT 1 FROM ".ROSCMST_FILTER." WHERE user_id = :user_id AND name = :title LIMIT 1"); + // insert new filter + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_FILTER." ( id, user_id, name, setting ) VALUES ( NULL, :user_id, :title, :setting )"); $stmt->bindParam('user_id',$thisuser->id(),PDO::PARAM_INT); - $stmt->bindParam('title',$_GET['d_val3'],PDO::PARAM_STR); - $stmt->execute(); - if ($stmt->fetchColumn() === false) { - - // insert new filter - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_FILTER." ( id, user_id, name, setting ) VALUES ( NULL, :user_id, :title, :string )"); - $stmt->bindParam('user_id',$thisuser->id(),PDO::PARAM_INT); - $stmt->bindParam('title',$_GET['d_val3'],PDO::PARAM_STR); - $stmt->bindParam('string',$_GET['d_val4'],PDO::PARAM_STR); - $stmt->execute(); - } - } - elseif ($_GET['d_val'] == 'del') { - // delete a label - $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_FILTER." WHERE id = :filter_id AND user_id = :user_id LIMIT 1"); - $stmt->bindParam('filter_id',$_GET['d_val3'],PDO::PARAM_INT); - $stmt->bindParam('user_id',$thisuser->id(),PDO::PARAM_INT); + $stmt->bindParam('title',$title,PDO::PARAM_STR); + $stmt->bindParam('setting',$setting,PDO::PARAM_STR); $stmt->execute(); } + } + + + /** + * deletes a smart filter + * + * @param string _GET['d_val3'] filter_title if adding its the filter name, if del it's the filter id + * @param string _GET['d_val4'] filter_string filter content + * @return + * @access private + */ + private function del( $filter_id ) + { + // delete a label + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_FILTER." WHERE id = :filter_id AND user_id = :user_id LIMIT 1"); + $stmt->bindParam('filter_id',$filter_id,PDO::PARAM_INT); + $stmt->bindParam('user_id',ThisUser::getInstance()->id(),PDO::PARAM_INT); + $stmt->execute(); + } + + + + /** + * deletes a smart filter + * + * @access private + */ + private function show( ) + { // echo current list of filters $stmt=&DBConnection::getInstance()->prepare("SELECT id, name, setting FROM ".ROSCMST_FILTER." WHERE user_id = :user_id ORDER BY name ASC"); - $stmt->bindParam('user_id',$thisuser->id(),PDO::PARAM_INT); + $stmt->bindParam('user_id',ThisUser::getInstance()->id(),PDO::PARAM_INT); $stmt->execute(); while ($filter = $stmt->fetch(PDO::FETCH_ASSOC)) { echo_strip(' @@ -90,10 +116,9 @@ // give standard text, if no filters are found if ($filter === false) { - echo '<span>Compose your favorite filter combinations and afterwards use the "save" function.</span>'; + echo '<span>Compose your favorite filter combinations and afterwards use the "save" function.</span>'; } - - } // end of member function manage + } Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteLabel.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteLabel.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsiteLabel.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -30,21 +30,16 @@ { Login::required(); - $this->output(); + $this->show(); } // end of member function __construct /** * cares about filter management: adding, deleting, listing * - * @param string _GET['d_value'] action 'add' or 'del' - * @param string _GET['d_value2'] type 'label' or not - * @param string _GET['d_value3'] filter_title if adding its the filter name, if del it's the filter id - * @param string _GET['d_value4'] filter_string filter content - * @return * @access private */ - private function output( ) + private function show( ) { $thisuser = &ThisUser::getInstance(); Added:
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsitePreview.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsitePreview.class.php
(added) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/CMSWebsitePreview.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -1,0 +1,54 @@ +<?php + /* + RosCMS - ReactOS Content Management System + Copyright (C) 2007 Klemens Friedl <frik85(a)reactos.org> + 2008-2009 Danny Götte <dangerground(a)web.de> + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * class CMSWebsitePreview + * + */ +class CMSWebsitePreview +{ + + + /** + * + * @access public + */ + public function __construct( ) + { + Login::required(); + + $this->show($_GET['rev_id']); + } + + + /** + * + * + * @access private + */ + private function show( $rev_id ) + { + echo_strip(' + <iframe style="width:100%;height:600px;background-color: white;border: 1px solid black;" src="?page=data_out&d_f=page&d_val='.$rev_id.'"></iframe>'); + } // end of member function show + +} // end of CMSWebsitePreview +?> Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Data.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -431,7 +431,6 @@ } // update text content with new name - //@ADD check, for only updating dependent entries $stmt=&DBConnection::getInstance()->prepare("UPDATE ".ROSCMST_TEXT." SET content = REPLACE(REPLACE(content, :old_type_name, :new_type_name), :old_link, :new_link) WHERE content LIKE :search1 OR content LIKE :search2"); $stmt->bindParam('search1','%[#'.$old_type_short.'_'.$data['name'].']%',PDO::PARAM_STR); $stmt->bindParam('search2','%[#link_'.$data['name'].']%',PDO::PARAM_STR); @@ -566,7 +565,6 @@ // add Tags Tag::add($rev_id, 'number', $next_number, -1); - Tag::add($rev_id, 'number_sort', str_pad($next_number, 5, '0', STR_PAD_LEFT), -1); // padding with '0' Tag::add($rev_id, 'pub_date', date('Y-m-d'), -1); Tag::add($rev_id, 'pub_user', $thisuser->id(), -1); @@ -640,7 +638,7 @@ die('Set a valid language in your account settings!'); } elseif ($user_lang != $revision['lang_id']) { - echo 'As Language Maintainer you can only mark entries of "'.$user_lang.'" language as stable!'; + echo 'As Language Maintainer you can\'t mark entries of other languages as stable!'; continue; } } @@ -773,9 +771,8 @@ // move to archiv case 'va': - Data::copy($revision['id'], 0, $lang_id); + Data::toArchive($revision['id']); Data::deleteFile($revision['id']); - Data::deleteRevision($revision['id']); break; } // switch } // for @@ -847,93 +844,67 @@ /** - * - * - * @param int data_id - * @param int rev_id - * @param bool archive_mode - * @param string lang + * creates a new revision suitable for a new translation + * + * @param int rev_id the revision id which has to be translated + * @param int lang_id translated to this language * @return bool * @access public */ - public static function copy($rev_id, $archive_mode, $lang_id = 0 ) - { - // set archive mode dependent vars - if ($archive_mode == 0) { - // copy to archive - $archive_mode = true; - } - elseif ($archive_mode == 1) { - // create copy - $archive_mode = false; - } - else { - die('move_to_archive: wrong param'); - } - - // Log something - if ($archive_mode === false) { - Log::writeLow('copy entire entry (e.g. translate): rev-id '.$rev_id.Log::prepareInfo(null, $rev_id).'{move_to_archive}'); - } - else { - Log::writeMedium('move entire entry to archive: rev-id '.$rev_id.Log::prepareInfo(null, $rev_id).'{move_to_archive}'); - } - - // data_revision - $stmt=&DBConnection::getInstance()->prepare("SELECT r.data_id, d.name, d.type, d.access_id, r.version, r.user_id, r.lang_id, r.datetime FROM ".ROSCMST_REVISIONS." r JOIN ".ROSCMST_ENTRIES." d ON r.data_id=d.id WHERE r.id = :rev_id LIMIT 1"); + public static function newTranslation($rev_id, $lang_id = 0 ) + { + // original_revision + $stmt=&DBConnection::getInstance()->prepare("SELECT id, data_id, lang_id FROM ".ROSCMST_REVISIONS." WHERE id = :rev_id LIMIT 1"); $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT); $stmt->execute(); $revision = $stmt->fetchOnce(PDO::FETCH_ASSOC); - if ($archive_mode === false) { - $revision = array( - 'data_id' => $revision['data_id'], - 'version' => '0', - 'user_id' => ThisUser::getInstance()->id(), - 'lang_id' => $lang_id, - 'datetime' => date('Y-m-d H:i:s')); - } - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_REVISIONS." ( id , data_id , version , lang_id , user_id , datetime ) VALUES ( NULL, :data_id, :version, :lang, :user_id, :datetime )"); + // check if we can translate to the selected language + if ($lang_id == $revision['lang_id'] || $lang_id == Language::getStandardId()) { + die ('Can\'t translate to your language language'); + } + + // insert translated revision + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_REVISIONS." ( id , data_id , version , lang_id , user_id , datetime ) VALUES ( NULL, :data_id, :version, :lang, :user_id, NOW() )"); $stmt->bindParam('data_id',$revision['data_id'],PDO::PARAM_INT); - $stmt->bindValue('version',$revision['version'],PDO::PARAM_INT); - $stmt->bindParam('lang',$revision['lang_id'],PDO::PARAM_INT); - $stmt->bindParam('user_id',$revision['user_id'],PDO::PARAM_INT); - $stmt->bindParam('datetime',$revision['datetime'],PDO::PARAM_STR); - $stmt->execute(); - - $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_REVISIONS." WHERE data_id = :data_id AND user_id=:user_id ORDER BY id DESC LIMIT 1"); + $stmt->bindValue('version',0,PDO::PARAM_INT); + $stmt->bindParam('lang',$lang_id,PDO::PARAM_INT); + $stmt->bindParam('user_id',ThisUser::getInstance()->id(),PDO::PARAM_INT); + $stmt->execute(); + + // get new revision id + $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_REVISIONS." WHERE data_id = :data_id AND user_id=:user_id AND lang_id=:lang_id ORDER BY id DESC LIMIT 1"); $stmt->bindParam('data_id',$revision['data_id'],PDO::PARAM_INT); - $stmt->bindParam('user_id',$revision['user_id'],PDO::PARAM_INT); + $stmt->bindParam('lang_id',$lang_id,PDO::PARAM_INT); + $stmt->bindParam('user_id',ThisUser::getInstance()->id(),PDO::PARAM_INT); $stmt->execute(); $new_rev_id = $stmt->fetchColumn(); + // check if copy process was successfull if ($new_rev_id === false) { die('copy-process of data_revision not successful'); } - - // copy stext - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_STEXT." ( id , rev_id , name , content ) SELECT NULL, :new_rev_id AS rev_id, name, content FROM ".ROSCMST_STEXT." WHERE rev_id = :old_rev_id"); + echo $new_rev_id.'--'.$revision['id']; + + // copy short text + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_STEXT." ( id , rev_id , name , content ) SELECT NULL, :new_rev_id, name, content FROM ".ROSCMST_STEXT." WHERE rev_id = :old_rev_id"); $stmt->bindParam('new_rev_id',$new_rev_id,PDO::PARAM_INT); - $stmt->bindParam('old_rev_id',$old_rev_id,PDO::PARAM_INT); + $stmt->bindParam('old_rev_id',$revision['id'],PDO::PARAM_INT); $stmt->execute(); // copy_text - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_TEXT." ( id , rev_id , name , content ) SELECT NULL, :new_rev_id AS rev_id, name, content FROM ".ROSCMST_TEXT." WHERE rev_id = :old_rev_id"); + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_TEXT." ( id , rev_id , name , content ) SELECT NULL, :new_rev_id, name, content FROM ".ROSCMST_TEXT." WHERE rev_id = :old_rev_id"); $stmt->bindParam('new_rev_id',$new_rev_id,PDO::PARAM_INT); - $stmt->bindParam('old_rev_id',$old_rev_id,PDO::PARAM_INT); - $stmt->execute(); - - - // data_tag - Tag::copyFromData($rev_id, $new_rev_id); - if ($archive_mode === false) { - // change status to draft - $tag_id = Tag::getIdByUser($new_rev_id, 'status', -1); - Tag::update($tag_id, 'draft'); - } + $stmt->bindParam('old_rev_id',$revision['id'],PDO::PARAM_INT); + $stmt->execute(); + + + // copy data tags and update status + Tag::copyFromData($revision['id'], $new_rev_id); + Tag::update(Tag::getIdByUser($new_rev_id, 'status', -1), 'draft'); return true; - } // end of member function compareGregorianDate + } // end of member function newTranslation Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Editor_Website.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -236,15 +236,14 @@ if (Data::hasAccess($revision['data_id'], 'translate')) { // copy existing entry to new language - if (Data::copy($revision['id'], 1 /* copy mode */, $_GET['d_r_lang'])) { + if (Data::newTranslation($revision['id'], $_GET['d_r_lang'])) { $stmt=&DBConnection::getInstance()->prepare("SELECT id FROM ".ROSCMST_REVISIONS." WHERE data_id = :data_id AND user_id = :user_id AND version = 0 AND lang_id = :lang ORDER BY id DESC LIMIT 1"); $stmt->bindParam('data_id',$revision['data_id'],PDO::PARAM_STR); $stmt->bindParam('user_id',ThisUser::getInstance()->id(),PDO::PARAM_INT); $stmt->bindParam('lang',$_GET['d_r_lang'],PDO::PARAM_STR); $stmt->execute(); - $translation = $stmt->fetchOnce(PDO::FETCH_ASSOC); - - $this->setRevision($translation['id']); + + $this->setRevision($stmt->fetchColumn()); $this->show(); } else { Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_Page.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_Page.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_Page.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -25,12 +25,6 @@ class Export_Page extends Export { - /** Aggregations: */ - - /** Compositions: */ - - /*** Attributes: ***/ - /** * @@ -40,61 +34,22 @@ public function __construct( ) { parent::__construct(); - $this->page(); + + + // remove "tr" so that it also work in translation view + $this->show(str_replace('tr', '', $_GET['d_val'])); } /** * - * @return - * @access public + * @access private */ - public function page( ) + private function show( $rev_id ) { - switch (@$_GET['d_u']) { - case 'output': - // @TODO - break; - - case 'show': - default: - if (empty($_GET['d_r_id']) || strpos($_GET['d_r_id'], 'tr') >= 0) { - // translation mode (contains "tr") - $lang = @$_GET['d_r_lang']; - } - else { - $lang = $_GET['d_val2']; - } - - // remove "tr" so that it also work in translation view - $data = str_replace('tr', '', $_GET['d_val']); - - if ( is_numeric($data) ) { - $stmt=&DBConnection::getInstance()->prepare("SELECT d.name, r.id, r.lang_id FROM ".ROSCMST_ENTRIES." d JOIN ".ROSCMST_REVISIONS." r ON d.id = r.data_id WHERE r.id = :rev_id ORDER BY r.version DESC LIMIT 1"); - $stmt->bindParam('rev_id',$data,PDO::PARAM_INT); - } - else { - $stmt=&DBConnection::getInstance()->prepare("SELECT d.name, r.id, r.lang_id FROM ".ROSCMST_ENTRIES." d JOIN ".ROSCMST_REVISIONS." r ON d.id = r.data_id WHERE d.name = :data_name AND r.lang_id IN(:lang_one, :lang_two) ORDER BY r.version DESC LIMIT 1"); - $stmt->bindParam('data_name',$data,PDO::PARAM_STR); - $stmt->bindParam('lang_one',$lang,PDO::PARAM_INT); - $stmt->bindParam('lang_two',Language::getStandardId(),PDO::PARAM_INT); - } - - $stmt->execute(); - $revision = $stmt->fetchOnce(PDO::FETCH_ASSOC); - if (empty($_GET['d_val3'])) { - $dynamic_num = Tag::getValueByUser($revision['id'], 'number', -1); - } - else { - $dynamic_num = $_GET['d_val3']; - } - - Log::writeGenerateLow('preview page: generate_page('.$revision['name'].', '.$revision['lang_id'].', '.$dynamic_num.', '.$_GET['d_u'].')'); - - $export_html = new Export_HTML(); - echo $export_html->processText($revision['id'], $_GET['d_u']); - break; - } + // output a preview of the selected content + $generate = new Generate(); + $generate->preview($rev_id); } Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_XML.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_XML.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Export_XML.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -320,7 +320,7 @@ $tdata .= ' status="'. $line_status .'"'; /* status (odd/even (=stable), new, draft, etc.) */ $tdata .= ' security="'. $security .'"'; /* security (read, write, add, pub, trans) */ $tdata .= ' xtrcol="'.$column_list_row.'"'; - $tdata .= '><![CDATA['.urlencode(substr($stext_content, 30)).']]></row>'; + $tdata .= '><![CDATA['.urlencode(substr($stext_content, 0, 30)).']]></row>'; $row_counter++; } // while @@ -419,8 +419,8 @@ break; case 'nbr': // number ("dynamic" entry) $tag_counter++; - $this->sql_order .= " t".$tag_counter.".value"; - $this->sql_where .= " AND t".$tag_counter.".name = 'number_sort' "; + $this->sql_order .= " CAST(t".$tag_counter.".value AS INT)"; + $this->sql_where .= " AND t".$tag_counter.".name = 'number' "; break; case 'type': // type $this->sql_order .= "d.type "; Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Generate.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Generate.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Generate.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -43,6 +43,9 @@ private $lang = null; private $short = array('template'=>'templ', 'content'=>'cont', 'script'=>'inc'); + + //@DEBUG + private $base_rev = 0; @@ -65,6 +68,52 @@ /** * + * @param int rev_id + * @return + * @access public + */ + public function preview( $rev_id ) + { + $this->rev_id=$rev_id; + + $stmt=&DBConnection::getInstance()->prepare("SELECT lang_id FROM ".ROSCMST_REVISIONS." WHERE id=:rev_id"); + $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT); + $stmt->execute(); + $this->lang_id = $stmt->fetchColumn(); + + $stmt=&DBConnection::getInstance()->prepare("SELECT content FROM ".ROSCMST_TEXT." WHERE rev_id=:rev_id AND name='content'"); + $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT); + $stmt->execute(); + $content = $stmt->fetchColumn(); + + // replace depencies + $stmt=&DBConnection::getInstance()->prepare("SELECT d.type, d.name FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE"); + $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT); + $stmt->execute(); + while ($depency = $stmt->fetch(PDO::FETCH_ASSOC)) { + + // replace + if ($depency['type'] != 'script') { + $content = str_replace('[#'.$this->short[$depency['type']].'_'.$depency['name'].']', $this->getCached(array(null, $this->short[$depency['type']].'_'.$depency['name'])), $content); + } + } + + // execute scripts + $content = preg_replace_callback('/\[#inc_([^][#[:space:]]+)\]/', array($this,'evalTemplate'),$content); + + // replace roscms vars + $content = $this->replaceRoscmsPlaceholder($content); + + // replace links + $content = preg_replace_callback('/\[#link_([^][#[:space:]]+)\]/', array($this, 'replaceWithHyperlink'), $content); + + echo $content; + } + + + + /** + * * * @return * @access public @@ -77,6 +126,7 @@ // caching $this->cacheFiles(); + // we need to reset this, as cacheFiles() overwrites this setting $this->base_dir = $this->destination_folder; // build all entries @@ -170,7 +220,6 @@ // file content $content = $revision['content']; $content = str_replace('[#%NAME%]', $data_name, $content); - $content = str_replace('[#cont_%NAME%]', '[#cont_'.$data_name.']', $content); // replace depencies $stmt_more=&DBConnection::getInstance()->prepare("SELECT d.id, d.type, d.name FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_ENTRIES." d ON w.child_id=d.id WHERE w.rev_id=:rev_id AND w.include IS TRUE"); @@ -183,11 +232,10 @@ if ($depency['type'] != 'script') { $content = str_replace('[#'.$this->short[$depency['type']].'_'.$depency['name'].']', $this->getCached(array(null, $this->short[$depency['type']].'_'.$depency['name'])), $content); } - // eval - else { - $content = str_replace('[#inc_'.$depency['name'].']', $this->evalTemplate(array(null,$depency['name'])), $content); - } - } + } + + // execute scripts + $content = preg_replace_callback('/\[#inc_([^][#[:space:]]+)\]/', array($this,'evalTemplate'),$content); // replace roscms vars $content = $this->replaceRoscmsPlaceholder($content); @@ -274,14 +322,19 @@ * @return * @access private */ - public function update( $rev_id ) - { + public function update( $rev_id, $from = null ) + { + // exclude the base ref to avoid circles + if ($this->base_rev === 0) { + $this->base_rev = $rev_id; + } $stmt=&DBConnection::getInstance()->prepare("SELECT data_id, lang_id FROM ".ROSCMST_REVISIONS." WHERE id=:rev_id"); $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT); $stmt->execute(); $revision=$stmt->fetchOnce(PDO::FETCH_ASSOC); + // set language for cache $this->lang_id = $revision['lang_id']; // cache data @@ -289,46 +342,58 @@ // set generating dir again $this->base_dir = $this->destination_folder; - - // update entries which depends on this one - $stmt=&DBConnection::getInstance()->prepare("SELECT r.lang_id, d.name, d.type, r.id FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_REVISIONS." r ON r.id=w.rev_id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id WHERE w.child_id=:depency_id AND w.rev_id != :rev_id AND r.archive IS FALSE AND w.include IS TRUE"); - $stmt->bindParam('depency_id',$revision['data_id'],PDO::PARAM_INT); - $stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT); - $stmt->execute(); - while ($depency = $stmt->fetch(PDO::FETCH_ASSOC)) { - + + // for usage in loop // in standard language we may have depencies to other languages, so better generate them all if ($revision['lang_id'] == Language::getStandardId()){ - $stmt_lang=&DBConnection::getInstance()->prepare("SELECT id, name_short FROM ".ROSCMST_LANGUAGES." ORDER BY level DESC"); + $stmt_lang=&DBConnection::getInstance()->prepare("SELECT id, name_short FROM ".ROSCMST_LANGUAGES." ORDER BY level DESC, name ASC"); } else { $stmt_lang=&DBConnection::getInstance()->prepare("SELECT id, name_short FROM ".ROSCMST_LANGUAGES." WHERE id=:lang_id"); $stmt_lang->bindParam('lang_id',$revision['lang_id'],PDO::PARAM_INT); } - $stmt_lang->execute(); - while ($language = $stmt_lang->fetch(PDO::FETCH_ASSOC)) { - - // language settings for generating process - $this->lang_id=$language['id']; - $this->lang=$language['name_short']; - - // cache recursivly or generate page - switch ($depency['type']) { - case 'page': - $this->oneEntry($depency['name'], $language['id']); - break; - case 'dynamic': - $this->makeDynamic($depency['name'], $language['id']); - break; - case 'script': - // scripts are only executed by in pages - break; - default: - $this->update($depency['id']); - break; - } - } - } + + // get list of entries which depend on this one and handle their types + $stmt=&DBConnection::getInstance()->prepare("SELECT r.lang_id, d.name, d.type, r.id FROM ".ROSCMST_DEPENCIES." w JOIN ".ROSCMST_REVISIONS." r ON r.id=w.rev_id JOIN ".ROSCMST_ENTRIES." d ON d.id=r.data_id WHERE w.child_id=:depency_id AND w.rev_id NOT IN(:rev_id,:rev_id2) AND r.archive IS FALSE AND w.include IS TRUE"); + $stmt->bindParam('depency_id',$revision['data_id'],PDO::PARAM_INT); + $stmt->bindParam('rev_id',$this->base_rev,PDO::PARAM_INT); + $stmt->bindParam('rev_id2',$rev_id,PDO::PARAM_INT); + $stmt->execute(); + while ($depency = $stmt->fetch(PDO::FETCH_ASSOC)) { + + + // cache recursivly or generate page + switch ($depency['type']) { + case 'page': + case 'dynamic': + + // generate pages for all languages, if standard lang, otherwise only once + $stmt_lang->execute(); + while ($language = $stmt_lang->fetch(PDO::FETCH_ASSOC)) { + + // language settings for generating process + $this->lang_id=$language['id']; + $this->lang=$language['name_short']; + + // seperate functions for pages & dynamic pages (in that order) + if($depency['type'] == 'page') { + $this->oneEntry($depency['name'], $language['id']); + } + else { + $this->makeDynamic($depency['name'], $language['id']); + } + } // end while language + break; + + case 'script': + // scripts are only executed by in pages + break; + default: + // only run update once per $rev_id + $this->update($depency['id']); + break; + } // end switch + } // end while depency } @@ -566,7 +631,6 @@ // check if depency not available if (count($results) === 0){ - //echo '<p>* <strong>Not found ('.$type.': '.$name.')</strong></p>'; return false; } @@ -672,7 +736,7 @@ { $revision = $this->getFrom('script',$matches[1]); - if( Tag::getValue($revision['id'], 'kind',-1) == 'php') { + if( Tag::getValueByUser($revision['id'], 'kind',-1) == 'php') { // catch output ob_start(); Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/HTML_CMS_Website.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -295,17 +295,17 @@ </select> </div> <div id="tablecmdbar" style="padding-top: 5px;"></div> - <div style="border: 0px dashed red; position: absolute; right: 10px; text-align:right; white-space: nowrap;"> - <span id="mtblnav"> </span> - </div> - <div class="tabselect">Select: <span id="tabselect1"></span></div> - <div id="tablist"> </div> - <div style="border: 0px dashed red; position: absolute; right: 10px; text-align:right; white-space: nowrap;"> - <span id="mtbl2nav"> </span> - </div> - <div class="tabselect">Select: <span id="tabselect2"></span></div> - </div> - <div id="frameedit" style="display: block; border: 0px dashed red; "> + <div style="border: 0px dashed red; position: absolute; right: 10px; text-align:right; white-space: nowrap;"> + <span id="mtblnav"> </span> + </div> + <div class="tabselect">Select: <span id="tabselect1"></span></div> + <div id="tablist"> </div> + <div style="border: 0px dashed red; position: absolute; right: 10px; text-align:right; white-space: nowrap;"> + <span id="mtbl2nav"> </span> + </div> + <div class="tabselect">Select: <span id="tabselect2"></span></div> + </div> + <div id="frameedit" style="display: block; border: 0px dashed red; "> <div id="frmedithead" style="padding-bottom: 10px;"> </div> <div style="width:100%;"> @@ -313,6 +313,11 @@ <div id="frmdiff"></div> </div> </div> + <div id="previewarea" style="display:none;"> + <div id="previewhead" style="padding-bottom: 10px;"> </div> + <div id="previewzone"> </div> + </div> + </div> <div class="corner_BL"> <div class="corner_BR"></div> @@ -334,7 +339,7 @@ <tr> <td class="lbox" style="background-color:#eeeeee"> </td> <td class="lbox" style="background-color:#A3EDB4"> </td> - <td>Translation up to date</td> + <td>Translation up to date</td> </tr> <tr> <td class="lbox" style="background-color:#B5EDA3"> </td> Added:
branches/danny-web/reactos.org/htdocs/roscms/lib/Presentation.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Presentation.class.php
(added) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Presentation.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -1,0 +1,64 @@ +<?php + /* + RosCMS - ReactOS Content Management System + Copyright (C) 2009 Danny Götte <dangerground(a)web.de> + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/** + * class Presentation + * + */ +class Presentation +{ + + + + /** + * + * + * @param string text + * @return + * @access private + */ + public static function verticalText( $text ) + { + $font = 2; + + // initial values + $width = 20; + $height = strlen($text)*imagefontwidth($font); + + $image = @imagecreatetruecolor($width, $height+5) or die('Cannot initialize new GD image stream'); + + // background + $bgcolor = imagecolorallocate($image, 255, 255, 255); + imagefill($image, 0, 0, $bgcolor); + + // Set text + $textcolor = imagecolorallocate($image, 0, 0, 0); + imagestringup($image, $font, 0, $height-1, $text, $textcolor); + + // output captcha image to browser + header('Content-Type: image/png'); + header('Cache-control: no-cache, no-store'); + imagepng($image); + imagedestroy($image); + } + +} // end of Presentation +?> Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/Tag.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/Tag.class.php
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/Tag.class.php
[iso-8859-1] Sun Jan 25 05:25:18 2009 @@ -126,7 +126,6 @@ */ public static function add( $rev_id, $tag_name, $tag_value, $user_id ) { - //@ADD group membership check if ($user_id != ThisUser::getInstance()->id() && $user_id != 0 && $user_id != -1) { die('ERROR: no rights to access this function'); }
15 years, 11 months
1
0
0
0
[martinf] 39085: update to VS2008 format project files
by martinf@svn.reactos.org
Author: martinf Date: Sun Jan 25 05:21:49 2009 New Revision: 39085 URL:
http://svn.reactos.org/svn/reactos?rev=39085&view=rev
Log: update to VS2008 format project files Modified: trunk/reactos/base/shell/explorer/explorer.sln Modified: trunk/reactos/base/shell/explorer/explorer.sln URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
============================================================================== --- trunk/reactos/base/shell/explorer/explorer.sln [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/explorer.sln [iso-8859-1] Sun Jan 25 05:21:49 2009 @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explorer", "explorer.vcproj", "{BFBAE588-8C68-4303-9BF6-C830087D8F25}" ProjectSection(ProjectDependencies) = postProject {F28B575D-7DBA-44DE-AAEF-FA0D065E5162} = {F28B575D-7DBA-44DE-AAEF-FA0D065E5162}
15 years, 11 months
1
0
0
0
[martinf] 39084: update XMLStorage to the current version, compatible to VS2008 and GCC@Linux
by martinf@svn.reactos.org
Author: martinf Date: Sun Jan 25 05:20:47 2009 New Revision: 39084 URL:
http://svn.reactos.org/svn/reactos?rev=39084&view=rev
Log: update XMLStorage to the current version, compatible to VS2008 and GCC@Linux Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp trunk/reactos/base/shell/explorer/utility/xmlstorage.h trunk/reactos/base/shell/explorer/utility/xs-native.cpp Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp [iso-8859-1] Sun Jan 25 05:20:47 2009 @@ -2,7 +2,7 @@ // // XML storage C++ classes version 1.3 // - // Copyright (c) 2004, 2005, 2006, 2007, 2008 Martin Fuchs <martin-fuchs(a)gmx.net> + // Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 Martin Fuchs <martin-fuchs(a)gmx.net> // /// \file xmlstorage.cpp @@ -37,12 +37,13 @@ */ +#include <precomp.h> + #ifndef XS_NO_COMMENT -#define XS_NO_COMMENT // no #pragma comment(lib, ...) statements in .lib files +#define XS_NO_COMMENT // no #pragma comment(lib, ...) statements in .lib files to enable static linking #endif //#include "xmlstorage.h" -#include <precomp.h> namespace XMLStorage { @@ -280,15 +281,17 @@ XMLNode* node = this; for(XPath::const_iterator it=xpath.begin(); it!=xpath.end(); ++it) { - XMLNode* child = it->find(this); + XMLNode* child = it->find(node); if (!child) { child = new XMLNode(it->_child_name); - add_child(child); + node->add_child(child); if (!it->_attr_name.empty()) (*this)[it->_attr_name] = it->_attr_value; } + + node = child; } return node; @@ -374,7 +377,7 @@ if (cdata) { // encode the whole string in a CDATA section - std::string ret = "<![CDATA["; + std::string ret = CDATA_START; #ifdef XS_STRING_UTF8 ret += str; @@ -382,7 +385,7 @@ ret += get_utf8(str); #endif - ret += "]]>"; + ret += CDATA_END; return ret; } else if (l <= BUFFER_LEN) { @@ -504,7 +507,7 @@ } else //@@ maybe decode "&#xx;" special characters *o++ = *p; } else if (*p=='<' && !XS_nicmp(p+1,XS_TEXT("![CDATA["),8)) { - LPCXSSTR e = XS_strstr(p+9, XS_TEXT("]]>")); + LPCXSSTR e = XS_strstr(p+9, XS_TEXT(CDATA_END)); if (e) { p += 9; size_t l = e - p; @@ -532,7 +535,7 @@ out << '>'; if (_cdata_content) - out << EncodeXMLString(DecodeXMLString(_content), true); + out << CDATA_START << _content << CDATA_END; else out << _content; @@ -632,7 +635,7 @@ out << '>'; if (_cdata_content) - out << EncodeXMLString(DecodeXMLString(_content), true); + out << CDATA_START << _content << CDATA_END; else if (!*content) out << format._endl; else @@ -897,7 +900,7 @@ const char* e = s + _content.length(); const char* p; - if (!strncmp(s,"<![CDATA[",9) && !strncmp(e-3,"]]>",3)) { + if (!strncmp(s,CDATA_START,9) && !strncmp(e-3,CDATA_END,3)) { s += 9; p = (e-=3); Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xmlstorage.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/xmlstorage.h [iso-8859-1] Sun Jan 25 05:20:47 2009 @@ -2,7 +2,7 @@ // // XML storage C++ classes version 1.3 // - // Copyright (c) 2004, 2005, 2006, 2007, 2008 Martin Fuchs <martin-fuchs(a)gmx.net> + // Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 Martin Fuchs <martin-fuchs(a)gmx.net> // /// \file xmlstorage.h @@ -60,7 +60,7 @@ #endif -#if _MSC_VER>=1400 +#if _MSC_VER>=1400 // VS2005 or higher #ifndef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1 @@ -119,26 +119,32 @@ #ifndef _STRING_DEFINED // _STRING_DEFINED only allowed if using xmlstorage.cpp embedded in the project #if defined(_DEBUG) && defined(_DLL) // DEBUG version only supported with MSVCRTD -#if _MSC_VER==1400 +#if _MSC_VER==1500 +#pragma comment(lib, "xmlstorage-vc9d") +#elif _MSC_VER==1400 #pragma comment(lib, "xmlstorage-vc8d") #else #pragma comment(lib, "xmlstorage-vc6d") #endif #else #ifdef _DLL -#if _MSC_VER==1400 +#if _MSC_VER==1500 +#pragma comment(lib, "xmlstorage-vc9") +#elif _MSC_VER==1400 #pragma comment(lib, "xmlstorage-vc8") #else #pragma comment(lib, "xmlstorage-vc6") #endif #elif defined(_MT) -#if _MSC_VER==1400 +#if _MSC_VER==1500 +#pragma comment(lib, "xmlstorage-vc9t") +#elif _MSC_VER==1400 #pragma comment(lib, "xmlstorage-vc8t") #else #pragma comment(lib, "xmlstorage-vc6t") #endif #else - // -ML is no more supported by VS2005. + // -ML is no more supported since VS2005. #pragma comment(lib, "xmlstorage-vc6l") #endif #endif @@ -159,9 +165,11 @@ #include <stdio.h> // vsnprintf(), snprintf() #endif -#else +#else // _WIN32 #include <wchar.h> +#include <stdlib.h> +#include <string.h> // strcasecmp() #include <stdarg.h> typedef char CHAR; @@ -199,7 +207,7 @@ #define _tcsnicmp strncasecmp #endif -#endif +#endif // _WIN32 #ifdef __BORLANDC__ #define _stricmp stricmp @@ -418,6 +426,9 @@ extern const XS_String XS_VALUE; extern const XS_String XS_PROPERTY; +#define CDATA_START "<![CDATA[" +#define CDATA_END "]]>" + #ifndef XS_STRING_UTF8 @@ -820,6 +831,7 @@ struct XPath : std::list<XPathElement> { + XPath() : _absolute(false) {} XPath(const char* path) {init(path);} XPath(const std::string path) {init(path.c_str());} @@ -1183,7 +1195,7 @@ /// set content of a subnode specified by an XPath expression bool set_sub_content(const XPath& xpath, const XS_String& s, bool cdata=false) { - XMLNode* node = find_relative(xpath); + XMLNode* node = create_relative(xpath); if (node) { node->set_content(s, cdata); @@ -1231,6 +1243,20 @@ /// copy matching tree nodes using the given XPath filter expression bool filter(const XPath& xpath, XMLNode& target) const; + /// XPath find function (const) + const XMLNode* find_relative(const XPath& xpath) const; + + /// XPath find function + XMLNode* find_relative(const XPath& xpath); + + XMLNode* get_first_child() const + { + if (!_children.empty()) + return _children.front(); + else + return NULL; + } + protected: Children _children; AttributeMap _attributes; @@ -1245,20 +1271,6 @@ #endif bool _cdata_content; - - XMLNode* get_first_child() const - { - if (!_children.empty()) - return _children.front(); - else - return NULL; - } - - /// XPath find function (const) - const XMLNode* find_relative(const XPath& xpath) const; - - /// XPath find function - XMLNode* find_relative(const XPath& xpath); /// relative XPath create function XMLNode* create_relative(const XPath& xpath); @@ -1590,6 +1602,19 @@ return false; } + /// iterate to the next matching child + bool iterate(const XS_String& child_name, size_t& cnt) + { + XMLNode* node = XPathElement(child_name, cnt).find(_cur); + + if (node) { + go_to(node); + ++cnt; + return true; + } else + return false; + } + /// move to the position defined by xpath in XML tree bool go(const XPath& xpath); @@ -1733,6 +1758,8 @@ {set_property(key, XS_String(value), name);} protected: + friend struct const_XMLPos; // access to _root + XMLNode* _root; XMLNode* _cur; std::stack<XMLNode*> _stack; @@ -1756,6 +1783,12 @@ } const_XMLPos(const const_XMLPos& other) + : _root(other._root), + _cur(other._cur) + { // don't copy _stack + } + + const_XMLPos(const XMLPos& other) : _root(other._root), _cur(other._cur) { // don't copy _stack @@ -1813,6 +1846,19 @@ if (node) { go_to(node); + return true; + } else + return false; + } + + /// iterate to the next matching child + bool iterate(const XS_String& child_name, size_t& cnt) + { + const XMLNode* node = XPathElement(child_name, cnt).const_find(_cur); + + if (node) { + go_to(node); + ++cnt; return true; } else return false; @@ -2666,6 +2712,11 @@ return read(reader, system_id); } + bool read_buffer(const std::string& in, const std::string& system_id=std::string()) + { + return read_buffer(in.c_str(), in.length(), system_id); + } + #else // XS_USE_XERCES bool read_file(LPCTSTR path) @@ -2682,12 +2733,17 @@ bool read_buffer(const char* buffer, size_t len, const std::string& system_id=std::string()) { - std::istringstream in(std::string(buffer, len)); - - return read(in, system_id); - } - - bool read(std::istream& in, const std::string& system_id=std::string()) + return read_buffer(std::string(buffer, len), system_id); + } + + bool read_buffer(const std::string& buffer, const std::string& system_id=std::string()) + { + std::istringstream istr(buffer); + + return read_stream(istr, system_id); + } + + bool read_stream(std::istream& in, const std::string& system_id=std::string()) { XMLReader reader(this, in); @@ -2880,7 +2936,7 @@ protected: tofstream* _pofstream; std::ostream& _out; - const XMLFormat&_format; + XMLFormat _format; typedef XMLNode::AttributeMap AttrMap; Modified: trunk/reactos/base/shell/explorer/utility/xs-native.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xs-native.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/xs-native.cpp [iso-8859-1] Sun Jan 25 05:20:47 2009 @@ -2,7 +2,7 @@ // // XML storage C++ classes version 1.3 // - // Copyright (c) 2006, 2007, 2008 Martin Fuchs <martin-fuchs(a)gmx.net> + // Copyright (c) 2006, 2007, 2008, 2009 Martin Fuchs <martin-fuchs(a)gmx.net> // /// \file xs-native.cpp @@ -37,12 +37,13 @@ */ +#include <precomp.h> + #ifndef XS_NO_COMMENT #define XS_NO_COMMENT // no #pragma comment(lib, ...) statements in .lib files to enable static linking #endif //#include "xmlstorage.h" -#include <precomp.h> #if !defined(XS_USE_EXPAT) && !defined(XS_USE_XERCES) @@ -131,7 +132,7 @@ //if (_wptr-_buffer < 3) // return false; - return !strncmp(_wptr-3, "]]>", 3); + return !strncmp(_wptr-3, CDATA_END, 3); } XS_String get_tag() const @@ -318,7 +319,7 @@ _format._doctype.parse(str+10); c = eat_endl(); - } else if (!strncmp(str+2, "[CDATA[", 7)) { + } else if (!strncmp(str+2, "[CDATA[", 7)) { // see CDATA_START // parse <![CDATA[ ... ]]> strings while(!buffer.has_CDEnd()) { c = get();
15 years, 11 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
76
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Results per page:
10
25
50
100
200